mercurial/commands.py
changeset 6161 bc1ba9124799
parent 6146 e3dd35d3603b
child 6163 1f733c2f0165
equal deleted inserted replaced
6160:3ee3bc5d06c5 6161:bc1ba9124799
   175 
   175 
   176     Commit the backed out changes as a new changeset.  The new
   176     Commit the backed out changes as a new changeset.  The new
   177     changeset is a child of the backed out changeset.
   177     changeset is a child of the backed out changeset.
   178 
   178 
   179     If you back out a changeset other than the tip, a new head is
   179     If you back out a changeset other than the tip, a new head is
   180     created.  This head is the parent of the working directory.  If
   180     created.  This head will be the new tip and you should merge this
   181     you back out an old changeset, your working directory will appear
   181     backout changeset with another head (current one by default).
   182     old after the backout.  You should merge the backout changeset
       
   183     with another head.
       
   184 
   182 
   185     The --merge option remembers the parent of the working directory
   183     The --merge option remembers the parent of the working directory
   186     before starting the backout, then merges the new head with that
   184     before starting the backout, then merges the new head with that
   187     changeset afterwards.  This saves you from doing the merge by
   185     changeset afterwards.  This saves you from doing the merge by
   188     hand.  The result of this merge is not committed, as for a normal
   186     hand.  The result of this merge is not committed, as for a normal
   241     def nice(node):
   239     def nice(node):
   242         return '%d:%s' % (repo.changelog.rev(node), short(node))
   240         return '%d:%s' % (repo.changelog.rev(node), short(node))
   243     ui.status(_('changeset %s backs out changeset %s\n') %
   241     ui.status(_('changeset %s backs out changeset %s\n') %
   244               (nice(repo.changelog.tip()), nice(node)))
   242               (nice(repo.changelog.tip()), nice(node)))
   245     if op1 != node:
   243     if op1 != node:
       
   244         hg.clean(repo, op1, show_stats=False)
   246         if opts['merge']:
   245         if opts['merge']:
   247             ui.status(_('merging with changeset %s\n') % nice(op1))
   246             ui.status(_('merging with changeset %s\n') % nice(repo.changelog.tip()))
   248             hg.merge(repo, hex(op1))
   247             hg.merge(repo, hex(repo.changelog.tip()))
   249         else:
   248         else:
   250             ui.status(_('the backout changeset is a new head - '
   249             ui.status(_('the backout changeset is a new head - '
   251                         'do not forget to merge\n'))
   250                         'do not forget to merge\n'))
   252             ui.status(_('(use "backout --merge" '
   251             ui.status(_('(use "backout --merge" '
   253                         'if you want to auto-merge)\n'))
   252                         'if you want to auto-merge)\n'))