[PATCH 1 of 2 evolve-ext] evolve: small refactoring of the uncommit function

Laurent Charignon lcharignon at fb.com
Wed May 27 15:09:14 CDT 2015


# HG changeset patch
# User Laurent Charignon <lcharignon at fb.com>
# Date 1432747417 25200
#      Wed May 27 10:23:37 2015 -0700
# Node ID fbd84a68ded6254766745d32e5e74b44d6b488e6
# Parent  9a1415f8b21b2936aecd030433e6dbc869ebcaaf
evolve: small refactoring of the uncommit function

We introduce a new variable to simplify the implementation of hg uncommit
--interactive.

diff --git a/hgext/evolve.py b/hgext/evolve.py
--- a/hgext/evolve.py
+++ b/hgext/evolve.py
@@ -2131,8 +2131,8 @@
         # Recommit the filtered changeset
         tr = repo.transaction('uncommit')
         newid = None
-        if (pats or opts.get('include') or opts.get('exclude')
-            or opts.get('all')):
+        includeorexclude = opts.get('include') or opts.get('exclude')
+        if (pats or includeorexclude or opts.get('all')):
             match = scmutil.match(old, pats, opts)
             newid = _commitfiltered(repo, old, match, target=rev)
         if newid is None:


More information about the Mercurial-devel mailing list