mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 15:27:13 +03:00
rebase: add error codes
Suggested by Dirk Hasselbalch
This commit is contained in:
parent
639d751bf4
commit
dd998094a7
@ -69,6 +69,8 @@ def rebase(ui, repo, **opts):
|
||||
|
||||
If a rebase is interrupted to manually resolve a merge, it can be
|
||||
continued with --continue/-c or aborted with --abort/-a.
|
||||
|
||||
Returns 0 on success, 1 if nothing to rebase.
|
||||
"""
|
||||
originalwd = target = None
|
||||
external = nullrev
|
||||
@ -115,8 +117,7 @@ def rebase(ui, repo, **opts):
|
||||
(originalwd, target, state, collapsef, keepf,
|
||||
keepbranchesf, external) = restorestatus(repo)
|
||||
if abortf:
|
||||
abort(repo, originalwd, target, state)
|
||||
return
|
||||
return abort(repo, originalwd, target, state)
|
||||
else:
|
||||
if srcf and basef:
|
||||
raise error.ParseError('rebase', _('cannot specify both a '
|
||||
@ -134,7 +135,7 @@ def rebase(ui, repo, **opts):
|
||||
if not result:
|
||||
# Empty state built, nothing to rebase
|
||||
ui.status(_('nothing to rebase\n'))
|
||||
return
|
||||
return 1
|
||||
else:
|
||||
originalwd, target, state = result
|
||||
if collapsef:
|
||||
@ -428,6 +429,7 @@ def abort(repo, originalwd, target, state):
|
||||
if set(repo.changelog.descendants(target)) - set(state.values()):
|
||||
repo.ui.warn(_("warning: new changesets detected on target branch, "
|
||||
"can't abort\n"))
|
||||
return -1
|
||||
else:
|
||||
# Strip from the first rebased revision
|
||||
merge.update(repo, repo[originalwd].rev(), False, True, False)
|
||||
@ -438,6 +440,7 @@ def abort(repo, originalwd, target, state):
|
||||
repair.strip(repo.ui, repo, repo[strippoint].node())
|
||||
clearstatus(repo)
|
||||
repo.ui.status(_('rebase aborted\n'))
|
||||
return 0
|
||||
|
||||
def buildstate(repo, dest, src, base, detach):
|
||||
'Define which revisions are going to be rebased and where'
|
||||
|
@ -47,6 +47,8 @@ move changeset (and descendants) to a different branch
|
||||
If a rebase is interrupted to manually resolve a merge, it can be
|
||||
continued with --continue/-c or aborted with --abort/-a.
|
||||
|
||||
Returns 0 on success, 1 if nothing to rebase.
|
||||
|
||||
options:
|
||||
|
||||
-s --source rebase from the specified changeset
|
||||
@ -111,6 +113,8 @@ move changeset (and descendants) to a different branch
|
||||
If a rebase is interrupted to manually resolve a merge, it can be
|
||||
continued with --continue/-c or aborted with --abort/-a.
|
||||
|
||||
Returns 0 on success, 1 if nothing to rebase.
|
||||
|
||||
options:
|
||||
|
||||
-s --source rebase from the specified changeset
|
||||
@ -175,6 +179,8 @@ move changeset (and descendants) to a different branch
|
||||
If a rebase is interrupted to manually resolve a merge, it can be
|
||||
continued with --continue/-c or aborted with --abort/-a.
|
||||
|
||||
Returns 0 on success, 1 if nothing to rebase.
|
||||
|
||||
options:
|
||||
|
||||
-s --source rebase from the specified changeset
|
||||
@ -239,6 +245,8 @@ move changeset (and descendants) to a different branch
|
||||
If a rebase is interrupted to manually resolve a merge, it can be
|
||||
continued with --continue/-c or aborted with --abort/-a.
|
||||
|
||||
Returns 0 on success, 1 if nothing to rebase.
|
||||
|
||||
options:
|
||||
|
||||
-s --source rebase from the specified changeset
|
||||
|
Loading…
Reference in New Issue
Block a user