485 hg.clean(repo, node, show_stats=False) |
485 hg.clean(repo, node, show_stats=False) |
486 repo.dirstate.setbranch(branch) |
486 repo.dirstate.setbranch(branch) |
487 cmdutil.revert(ui, repo, rctx, repo.dirstate.parents()) |
487 cmdutil.revert(ui, repo, rctx, repo.dirstate.parents()) |
488 |
488 |
489 |
489 |
490 e = cmdutil.commiteditor |
|
491 if not opts['message'] and not opts['logfile']: |
|
492 # we don't translate commit messages |
|
493 opts['message'] = "Backed out changeset %s" % short(node) |
|
494 e = cmdutil.commitforceeditor |
|
495 |
|
496 def commitfunc(ui, repo, message, match, opts): |
490 def commitfunc(ui, repo, message, match, opts): |
|
491 e = cmdutil.commiteditor |
|
492 if not message: |
|
493 # we don't translate commit messages |
|
494 message = "Backed out changeset %s" % short(node) |
|
495 e = cmdutil.commitforceeditor |
497 return repo.commit(message, opts.get('user'), opts.get('date'), |
496 return repo.commit(message, opts.get('user'), opts.get('date'), |
498 match, editor=e) |
497 match, editor=e) |
499 newnode = cmdutil.commit(ui, repo, commitfunc, [], opts) |
498 newnode = cmdutil.commit(ui, repo, commitfunc, [], opts) |
500 if not newnode: |
499 if not newnode: |
501 ui.status(_("nothing changed\n")) |
500 ui.status(_("nothing changed\n")) |