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

Adrian Buehlmann adrian at cadifra.com
Tue Aug 2 04:55:56 CDT 2011


# HG changeset patch
# User Adrian Buehlmann <adrian at cadifra.com>
# Date 1312277559 -7200
# Node ID caa5283390f84849fafb4acdbe6054ff43ef3075
# Parent  d0424f39984c6d623dc8c55b85de66f15e27abd6
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)".

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -4147,7 +4147,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