comparison mercurial/commands.py @ 6423:fb374b1b3911

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.
author Matt Mackall <mpm@selenic.com>
date Sat, 29 Mar 2008 12:39:47 -0500
parents 0d4e068e9e52
children b1204fd06c2e a60b711c7ac4
comparison
equal deleted inserted replaced
6422:3ee6f1fce94a 6423:fb374b1b3911
225 else: 225 else:
226 if opts['parent']: 226 if opts['parent']:
227 raise util.Abort(_('cannot use --parent on non-merge changeset')) 227 raise util.Abort(_('cannot use --parent on non-merge changeset'))
228 parent = p1 228 parent = p1
229 229
230 # the backout should appear on the same branch
231 branch = repo.dirstate.branch()
230 hg.clean(repo, node, show_stats=False) 232 hg.clean(repo, node, show_stats=False)
233 repo.dirstate.setbranch(branch)
231 revert_opts = opts.copy() 234 revert_opts = opts.copy()
232 revert_opts['date'] = None 235 revert_opts['date'] = None
233 revert_opts['all'] = True 236 revert_opts['all'] = True
234 revert_opts['rev'] = hex(parent) 237 revert_opts['rev'] = hex(parent)
235 revert_opts['no_backup'] = None 238 revert_opts['no_backup'] = None