hgext/uncommit.py
changeset 36974 435b8b05affd
parent 36973 d63c5c651183
child 38423 32fba6fe893d
--- a/hgext/uncommit.py	Sat Mar 17 09:49:21 2018 -0700
+++ b/hgext/uncommit.py	Sat Mar 17 09:33:17 2018 -0700
@@ -51,7 +51,7 @@
 # leave the attribute unspecified.
 testedwith = 'ships-with-hg-core'
 
-def _commitfiltered(repo, ctx, match, allowempty):
+def _commitfiltered(repo, ctx, match, keepcommit):
     """Recommit ctx with changed files not in match. Return the new
     node identifier, or None if nothing changed.
     """
@@ -66,7 +66,7 @@
 
     files = (initialfiles - exclude)
     # return the p1 so that we don't create an obsmarker later
-    if not files and not allowempty:
+    if not keepcommit:
         return ctx.parents()[0].node()
 
     # Filter copies
@@ -169,8 +169,8 @@
 
         with repo.transaction('uncommit'):
             match = scmutil.match(old, pats, opts)
-            allowempty = opts.get('keep') or pats
-            newid = _commitfiltered(repo, old, match, allowempty)
+            keepcommit = opts.get('keep') or pats
+            newid = _commitfiltered(repo, old, match, keepcommit)
             if newid is None:
                 ui.status(_("nothing to uncommit\n"))
                 return 1