Patchwork mq: report the negative guard is match if the negative guarded patch is pushable

login
register
mail settings
Submitter elson.wei@gmail.com
Date Sept. 4, 2013, 8:15 a.m.
Message ID <9ceb8651004e519b1a4f.1378282544@ElsonWei-NB.PrimeVOLT>
Download mbox | patch
Permalink /patch/2320/
State Rejected
Headers show

Comments

elson.wei@gmail.com - Sept. 4, 2013, 8:15 a.m.
# HG changeset patch
# User Wei, Elson <elson.wei@gmail.com>
# Date 1378282253 -28800
#      Wed Sep 04 16:10:53 2013 +0800
# Node ID 9ceb8651004e519b1a4f5ac6b32e882b1749a1fe
# Parent  73513cb8c379af12f3dfb9ae2dcab864239481ae
mq: report the negative guard is match if the negative guarded patch is pushable

Patch

diff --git a/hgext/mq.py b/hgext/mq.py
--- a/hgext/mq.py
+++ b/hgext/mq.py
@@ -507,9 +507,12 @@ 
         if not patchguards:
             return True, None
         guards = self.active()
-        exactneg = [g for g in patchguards if g[0] == '-' and g[1:] in guards]
-        if exactneg:
-            return False, repr(exactneg[0])
+        neg = [g for g in patchguards if g[0] == '-']
+        exactneg = [g for g in neg if g[1:] in guards]
+        if neg:
+            if exactneg:
+                return False, repr(exactneg[0])
+            return True, ' '.join(map(repr, neg))
         pos = [g for g in patchguards if g[0] == '+']
         exactpos = [g for g in pos if g[1:] in guards]
         if pos: