##// END OF EJS Templates
fetch: fix and document exit codes (issue2356)
Matt Mackall -
r12711:b885f28f default
parent child Browse files
Show More
@@ -29,6 +29,8 b" def fetch(ui, repo, source='default', **"
29 29 order, use --switch-parent.
30 30
31 31 See :hg:`help dates` for a list of formats valid for -d/--date.
32
33 Returns 0 on success.
32 34 '''
33 35
34 36 date = opts.get('date')
@@ -86,7 +88,7 b" def fetch(ui, repo, source='default', **"
86 88 if newchildren[0] != parent:
87 89 return hg.clean(repo, newchildren[0])
88 90 else:
89 return
91 return 0
90 92
91 93 # Are there more than one additional branch heads?
92 94 newchildren = [n for n in newchildren if n != parent]
@@ -99,7 +101,7 b" def fetch(ui, repo, source='default', **"
99 101 ui.status(_('not merging with %d other new branch heads '
100 102 '(use "hg heads ." and "hg merge" to merge them)\n') %
101 103 (len(newheads) - 1))
102 return
104 return 1
103 105
104 106 # Otherwise, let's merge.
105 107 err = False
@@ -132,6 +134,8 b" def fetch(ui, repo, source='default', **"
132 134 'with local\n') % (repo.changelog.rev(n),
133 135 short(n)))
134 136
137 return err
138
135 139 finally:
136 140 release(lock, wlock)
137 141
@@ -305,6 +305,7 b' heads) with a local change'
305 305 adding file changes
306 306 added 3 changesets with 2 changes to 1 files (+2 heads)
307 307 not merging with 1 other new branch heads (use "hg heads ." and "hg merge" to merge them)
308 [1]
308 309
309 310 parent should be 3 (fetch did not merge anything)
310 311
General Comments 0
You need to be logged in to leave comments. Login now