[PATCH 1 of 1] revert: introduce short option -C for --no-backup

Adrian Buehlmann adrian at cadifra.com
Sun Jun 26 07:00:09 CDT 2011


# HG changeset patch
# User Adrian Buehlmann <adrian at cadifra.com>
# Date 1309082709 -7200
# Branch stable
# Node ID 47e6975e8f36cc40d8e21c0e4f9b898b15b60b16
# Parent  bd25f70c66eed696ef0798e8343f3f3bbb1de99b
revert: introduce short option -C for --no-backup

Corresponds to -C of the update command.

It's much more convenient to use:

  $ hg revert -aC

than having to type

  $ hg revert -a --no-backup

I think the 'no-backup' case is a frequent use case.

Introducing short option -C here fits with the muscle memory we have from
'hg update -C', which is described there as "discard uncommitted changes
(no backup)".

The letter "C" can also be said to be reminiscent of "no copies".

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -4143,7 +4143,7 @@
     [('a', 'all', None, _('revert all changes when no arguments given')),
     ('d', 'date', '', _('tipmost revision matching date'), _('DATE')),
     ('r', 'rev', '', _('revert to the specified revision'), _('REV')),
-    ('', 'no-backup', None, _('do not save backup copies of files')),
+    ('C', 'no-backup', None, _('do not save backup copies of files')),
     ] + walkopts + dryrunopts,
     _('[OPTION]... [-r REV] [NAME]...'))
 def revert(ui, repo, *pats, **opts):


More information about the Mercurial-devel mailing list