mercurial/commands.py
branchstable
changeset 20872 3f83fc5cfe71
parent 20871 e01cff65f4c5
child 20875 cc62c9d6887a
equal deleted inserted replaced
20871:e01cff65f4c5 20872:3f83fc5cfe71
   414       cancel the merge and leave the child of REV as a head to be
   414       cancel the merge and leave the child of REV as a head to be
   415       merged separately.
   415       merged separately.
   416 
   416 
   417     See :hg:`help dates` for a list of formats valid for -d/--date.
   417     See :hg:`help dates` for a list of formats valid for -d/--date.
   418 
   418 
   419     Returns 0 on success, 1 if there are unresolved files.
   419     Returns 0 on success, 1 if nothing to backout or there are unresolved
       
   420     files.
   420     '''
   421     '''
   421     if rev and node:
   422     if rev and node:
   422         raise util.Abort(_("please specify just one revision"))
   423         raise util.Abort(_("please specify just one revision"))
   423 
   424 
   424     if not rev:
   425     if not rev:
   493 
   494 
   494         def commitfunc(ui, repo, message, match, opts):
   495         def commitfunc(ui, repo, message, match, opts):
   495             return repo.commit(message, opts.get('user'), opts.get('date'),
   496             return repo.commit(message, opts.get('user'), opts.get('date'),
   496                                match, editor=e)
   497                                match, editor=e)
   497         newnode = cmdutil.commit(ui, repo, commitfunc, [], opts)
   498         newnode = cmdutil.commit(ui, repo, commitfunc, [], opts)
       
   499         if not newnode:
       
   500             ui.status(_("nothing changed\n"))
       
   501             return 1
   498         cmdutil.commitstatus(repo, newnode, branch, bheads)
   502         cmdutil.commitstatus(repo, newnode, branch, bheads)
   499 
   503 
   500         def nice(node):
   504         def nice(node):
   501             return '%d:%s' % (repo.changelog.rev(node), short(node))
   505             return '%d:%s' % (repo.changelog.rev(node), short(node))
   502         ui.status(_('changeset %s backs out changeset %s\n') %
   506         ui.status(_('changeset %s backs out changeset %s\n') %