# HG changeset patch # User Matt Mackall # Date 1206812387 18000 # Node ID fb374b1b3911ce5d5861592142271bb230635ea0 # Parent 3ee6f1fce94a6f750419829bbb1fc3956a6a2207 backout: reverse changeset belongs on current branch Backing out a changeset that is before a named branch branchpoint was making the reverse changeset the tip of the old branch, which is wrong and very confusing. So instead, we put it on the current named branch. diff -r 3ee6f1fce94a -r fb374b1b3911 mercurial/commands.py --- a/mercurial/commands.py Sat Mar 29 12:39:47 2008 -0500 +++ b/mercurial/commands.py Sat Mar 29 12:39:47 2008 -0500 @@ -227,7 +227,10 @@ raise util.Abort(_('cannot use --parent on non-merge changeset')) parent = p1 + # the backout should appear on the same branch + branch = repo.dirstate.branch() hg.clean(repo, node, show_stats=False) + repo.dirstate.setbranch(branch) revert_opts = opts.copy() revert_opts['date'] = None revert_opts['all'] = True diff -r 3ee6f1fce94a -r fb374b1b3911 tests/test-backout.out --- a/tests/test-backout.out Sat Mar 29 12:39:47 2008 -0500 +++ b/tests/test-backout.out Sat Mar 29 12:39:47 2008 -0500 @@ -74,7 +74,7 @@ adding file2 removing file1 created new head -changeset 3:f1c642b1d8e5 backs out changeset 1:bf1602f437f3 +changeset 3:d4e8f6db59fb backs out changeset 1:bf1602f437f3 the backout changeset is a new head - do not forget to merge (use "backout --merge" if you want to auto-merge) % on branch2 with branch1 not merged, so file1 should still exist: @@ -85,10 +85,11 @@ % on branch2 with branch1 merged, so file1 should be gone: 0 files updated, 0 files merged, 1 files removed, 0 files unresolved (branch merge, don't forget to commit) -21d4dc6f9a41 (branch2) tip +22149cdde76d (branch2) tip C default C file2 % on branch1, so no file1 and file2: -0 files updated, 0 files merged, 1 files removed, 0 files unresolved -f1c642b1d8e5 (branch1) +1 files updated, 0 files merged, 1 files removed, 0 files unresolved +bf1602f437f3 (branch1) C default +C file1