[PATCH V2] mq: report the negative guard is match if the negative guarded patch is pushable

elson.wei at gmail.com elson.wei at gmail.com
Wed Sep 4 20:28:01 CDT 2013


# HG changeset patch
# User Wei, Elson <elson.wei at gmail.com>
# Date 1378344415 -28800
#      Thu Sep 05 09:26:55 2013 +0800
# Branch stable
# Node ID 3418b76aeb5c2f22020118a3923134a747b44551
# Parent  f37b5a17e6a0ee17afde2cdde5393dd74715fb58
mq: report the negative guard is match if the negative guarded patch is pushable

diff --git a/hgext/mq.py b/hgext/mq.py
--- a/hgext/mq.py
+++ b/hgext/mq.py
@@ -506,7 +506,8 @@
         if not patchguards:
             return True, None
         guards = self.active()
-        exactneg = [g for g in patchguards if g[0] == '-' and g[1:] in guards]
+        neg = [g for g in patchguards if g[0] == '-']
+        exactneg = [g for g in neg if g[1:] in guards]
         if exactneg:
             return False, repr(exactneg[0])
         pos = [g for g in patchguards if g[0] == '+']
@@ -515,7 +516,7 @@
             if exactpos:
                 return True, repr(exactpos[0])
             return False, ' '.join(map(repr, pos))
-        return True, ''
+        return True, ' '.join(map(repr, neg))
 
     def explainpushable(self, idx, all_patches=False):
         write = all_patches and self.ui.write or self.ui.warn


More information about the Mercurial-devel mailing list