uncommit: rename the flag 'empty' to 'keep' which retains empty changeset
authorPulkit Goyal <7895pulkit@gmail.com>
Sat, 16 Sep 2017 02:34:13 +0530
changeset 34283 f94442d46984
parent 34282 3e92322d3b1f
child 34284 624c53e4121d
uncommit: rename the flag 'empty' to 'keep' which retains empty changeset This patch renames the flag 'empty' which retains the empty changeset if all the files are uncommitted to 'keep'. Differential Revision: https://phab.mercurial-scm.org/D726
hgext/uncommit.py
tests/test-uncommit.t
--- a/hgext/uncommit.py	Mon Sep 18 14:19:47 2017 -0400
+++ b/hgext/uncommit.py	Sat Sep 16 02:34:13 2017 +0530
@@ -133,7 +133,7 @@
         ds.copy(src, dst)
 
 @command('uncommit',
-    [('', 'empty', False, _('allow an empty commit after uncommiting')),
+    [('', 'keep', False, _('allow an empty commit after uncommiting')),
     ] + commands.walkopts,
     _('[OPTION]... [FILE]...'))
 def uncommit(ui, repo, *pats, **opts):
@@ -163,7 +163,7 @@
 
         with repo.transaction('uncommit'):
             match = scmutil.match(old, pats, opts)
-            newid = _commitfiltered(repo, old, match, opts.get('empty'))
+            newid = _commitfiltered(repo, old, match, opts.get('keep'))
             if newid is None:
                 ui.status(_("nothing to uncommit\n"))
                 return 1
--- a/tests/test-uncommit.t	Mon Sep 18 14:19:47 2017 -0400
+++ b/tests/test-uncommit.t	Sat Sep 16 02:34:13 2017 +0530
@@ -30,7 +30,7 @@
   
   options ([+] can be repeated):
   
-      --empty               allow an empty commit after uncommiting
+      --keep                allow an empty commit after uncommiting
    -I --include PATTERN [+] include names matching the given patterns
    -X --exclude PATTERN [+] exclude names matching the given patterns
   
@@ -286,7 +286,7 @@
   > P
   > EOS
   $ hg up Q -q
-  $ hg uncommit --empty
+  $ hg uncommit --keep
   $ hg log -G -T '{desc} FILES: {files}'
   @  Q FILES:
   |