##// 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 order, use --switch-parent.
29 order, use --switch-parent.
30
30
31 See :hg:`help dates` for a list of formats valid for -d/--date.
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 date = opts.get('date')
36 date = opts.get('date')
@@ -86,7 +88,7 b" def fetch(ui, repo, source='default', **"
86 if newchildren[0] != parent:
88 if newchildren[0] != parent:
87 return hg.clean(repo, newchildren[0])
89 return hg.clean(repo, newchildren[0])
88 else:
90 else:
89 return
91 return 0
90
92
91 # Are there more than one additional branch heads?
93 # Are there more than one additional branch heads?
92 newchildren = [n for n in newchildren if n != parent]
94 newchildren = [n for n in newchildren if n != parent]
@@ -99,7 +101,7 b" def fetch(ui, repo, source='default', **"
99 ui.status(_('not merging with %d other new branch heads '
101 ui.status(_('not merging with %d other new branch heads '
100 '(use "hg heads ." and "hg merge" to merge them)\n') %
102 '(use "hg heads ." and "hg merge" to merge them)\n') %
101 (len(newheads) - 1))
103 (len(newheads) - 1))
102 return
104 return 1
103
105
104 # Otherwise, let's merge.
106 # Otherwise, let's merge.
105 err = False
107 err = False
@@ -132,6 +134,8 b" def fetch(ui, repo, source='default', **"
132 'with local\n') % (repo.changelog.rev(n),
134 'with local\n') % (repo.changelog.rev(n),
133 short(n)))
135 short(n)))
134
136
137 return err
138
135 finally:
139 finally:
136 release(lock, wlock)
140 release(lock, wlock)
137
141
@@ -305,6 +305,7 b' heads) with a local change'
305 adding file changes
305 adding file changes
306 added 3 changesets with 2 changes to 1 files (+2 heads)
306 added 3 changesets with 2 changes to 1 files (+2 heads)
307 not merging with 1 other new branch heads (use "hg heads ." and "hg merge" to merge them)
307 not merging with 1 other new branch heads (use "hg heads ." and "hg merge" to merge them)
308 [1]
308
309
309 parent should be 3 (fetch did not merge anything)
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