@@ -459,20 +459,27 @@ def backout(ui, repo, node=None, rev=Non
# the backout should appear on the same branch
wlock = repo.wlock()
try:
branch = repo.dirstate.branch()
bheads = repo.branchheads(branch)
- hg.clean(repo, node, show_stats=False)
- repo.dirstate.setbranch(branch)
rctx = scmutil.revsingle(repo, hex(parent))
- cmdutil.revert(ui, repo, rctx, repo.dirstate.parents())
if not opts.get('merge') and op1 != node:
try:
ui.setconfig('ui', 'forcemerge', opts.get('tool', ''))
- return hg.update(repo, op1)
+ stats = mergemod.update(repo, parent, True, True, False, node, False)
+ repo.setparents(op1, op2)
+ hg._showstats(repo, stats)
+ if stats[3]:
+ repo.ui.status(_("use 'hg resolve' to retry unresolved file merges\n"))
+ return stats[3] > 0
finally:
ui.setconfig('ui', 'forcemerge', '')
+ else:
+ hg.clean(repo, node, show_stats=False)
+ repo.dirstate.setbranch(branch)
+ cmdutil.revert(ui, repo, rctx, repo.dirstate.parents())
+
e = cmdutil.commiteditor
if not opts['message'] and not opts['logfile']:
# we don't translate commit messages
opts['message'] = "Backed out changeset %s" % short(node)
@@ -186,11 +186,10 @@ backout should not back out subsequent c
commit: (clean)
update: (current)
without --merge
$ hg backout -d '3 0' 1 --tool=true
- reverting a
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg locate b
b
$ hg update -C tip
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -322,12 +321,11 @@ named branches
$ hg ci -d '2 0' -Am file2
adding file2
without --merge
$ hg backout -r 1 --tool=true
- removing file1
- 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ hg branch
branch2
$ hg status -A
R file1
C default
@@ -466,15 +466,10 @@ update
backout calls revert internally with minimal opts, which should not raise
KeyError
$ hg backout ".^"
- reverting .hgsubstate
- reverting subrepo s
- reverting s/a (glob)
- reverting subrepo ss
- reverting subrepo t
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg up -C # discard changes
1 files updated, 0 files merged, 0 files removed, 0 files unresolved