##// END OF EJS Templates
rebase: add error codes...
Matt Mackall -
r11205:d26f662b default
parent child Browse files
Show More
@@ -69,6 +69,8 b' def rebase(ui, repo, **opts):'
69
69
70 If a rebase is interrupted to manually resolve a merge, it can be
70 If a rebase is interrupted to manually resolve a merge, it can be
71 continued with --continue/-c or aborted with --abort/-a.
71 continued with --continue/-c or aborted with --abort/-a.
72
73 Returns 0 on success, 1 if nothing to rebase.
72 """
74 """
73 originalwd = target = None
75 originalwd = target = None
74 external = nullrev
76 external = nullrev
@@ -115,8 +117,7 b' def rebase(ui, repo, **opts):'
115 (originalwd, target, state, collapsef, keepf,
117 (originalwd, target, state, collapsef, keepf,
116 keepbranchesf, external) = restorestatus(repo)
118 keepbranchesf, external) = restorestatus(repo)
117 if abortf:
119 if abortf:
118 abort(repo, originalwd, target, state)
120 return abort(repo, originalwd, target, state)
119 return
120 else:
121 else:
121 if srcf and basef:
122 if srcf and basef:
122 raise error.ParseError('rebase', _('cannot specify both a '
123 raise error.ParseError('rebase', _('cannot specify both a '
@@ -134,7 +135,7 b' def rebase(ui, repo, **opts):'
134 if not result:
135 if not result:
135 # Empty state built, nothing to rebase
136 # Empty state built, nothing to rebase
136 ui.status(_('nothing to rebase\n'))
137 ui.status(_('nothing to rebase\n'))
137 return
138 return 1
138 else:
139 else:
139 originalwd, target, state = result
140 originalwd, target, state = result
140 if collapsef:
141 if collapsef:
@@ -428,6 +429,7 b' def abort(repo, originalwd, target, stat'
428 if set(repo.changelog.descendants(target)) - set(state.values()):
429 if set(repo.changelog.descendants(target)) - set(state.values()):
429 repo.ui.warn(_("warning: new changesets detected on target branch, "
430 repo.ui.warn(_("warning: new changesets detected on target branch, "
430 "can't abort\n"))
431 "can't abort\n"))
432 return -1
431 else:
433 else:
432 # Strip from the first rebased revision
434 # Strip from the first rebased revision
433 merge.update(repo, repo[originalwd].rev(), False, True, False)
435 merge.update(repo, repo[originalwd].rev(), False, True, False)
@@ -438,6 +440,7 b' def abort(repo, originalwd, target, stat'
438 repair.strip(repo.ui, repo, repo[strippoint].node())
440 repair.strip(repo.ui, repo, repo[strippoint].node())
439 clearstatus(repo)
441 clearstatus(repo)
440 repo.ui.status(_('rebase aborted\n'))
442 repo.ui.status(_('rebase aborted\n'))
443 return 0
441
444
442 def buildstate(repo, dest, src, base, detach):
445 def buildstate(repo, dest, src, base, detach):
443 'Define which revisions are going to be rebased and where'
446 'Define which revisions are going to be rebased and where'
@@ -47,6 +47,8 b' move changeset (and descendants) to a di'
47 If a rebase is interrupted to manually resolve a merge, it can be
47 If a rebase is interrupted to manually resolve a merge, it can be
48 continued with --continue/-c or aborted with --abort/-a.
48 continued with --continue/-c or aborted with --abort/-a.
49
49
50 Returns 0 on success, 1 if nothing to rebase.
51
50 options:
52 options:
51
53
52 -s --source rebase from the specified changeset
54 -s --source rebase from the specified changeset
@@ -111,6 +113,8 b' move changeset (and descendants) to a di'
111 If a rebase is interrupted to manually resolve a merge, it can be
113 If a rebase is interrupted to manually resolve a merge, it can be
112 continued with --continue/-c or aborted with --abort/-a.
114 continued with --continue/-c or aborted with --abort/-a.
113
115
116 Returns 0 on success, 1 if nothing to rebase.
117
114 options:
118 options:
115
119
116 -s --source rebase from the specified changeset
120 -s --source rebase from the specified changeset
@@ -175,6 +179,8 b' move changeset (and descendants) to a di'
175 If a rebase is interrupted to manually resolve a merge, it can be
179 If a rebase is interrupted to manually resolve a merge, it can be
176 continued with --continue/-c or aborted with --abort/-a.
180 continued with --continue/-c or aborted with --abort/-a.
177
181
182 Returns 0 on success, 1 if nothing to rebase.
183
178 options:
184 options:
179
185
180 -s --source rebase from the specified changeset
186 -s --source rebase from the specified changeset
@@ -239,6 +245,8 b' move changeset (and descendants) to a di'
239 If a rebase is interrupted to manually resolve a merge, it can be
245 If a rebase is interrupted to manually resolve a merge, it can be
240 continued with --continue/-c or aborted with --abort/-a.
246 continued with --continue/-c or aborted with --abort/-a.
241
247
248 Returns 0 on success, 1 if nothing to rebase.
249
242 options:
250 options:
243
251
244 -s --source rebase from the specified changeset
252 -s --source rebase from the specified changeset
General Comments 0
You need to be logged in to leave comments. Login now