Patchwork [V2] 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. 5, 2013, 1:28 a.m.
Message ID <3418b76aeb5c2f220201.1378344481@ElsonWei-NB.PrimeVOLT>
Download mbox | patch
Permalink /patch/2331/
State Changes Requested
Headers show

Comments

elson.wei@gmail.com - Sept. 5, 2013, 1:28 a.m.
# HG changeset patch
# User Wei, Elson <elson.wei@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
Siddharth Agarwal - Sept. 7, 2013, 6:09 p.m.
On 09/07/2013 07:12 AM, elson wrote:
> May I know which test is fail?
> I've run: python run-tests.py test-mq*.t
> But I ran these 30 tests successful

Perhaps try running the entire test suite?
elson.wei@gmail.com - Sept. 8, 2013, 6:10 a.m.
I ran whole test suite.
First time: 425 pass, 33 skipped and test-keyword.t fail.
Then I ran test-keyword.t alone, It was pass.



2013/9/8 Siddharth Agarwal <sid0@fb.com>

> On 09/07/2013 07:12 AM, elson wrote:
>
>> May I know which test is fail?
>> I've run: python run-tests.py test-mq*.t
>> But I ran these 30 tests successful
>>
>
> Perhaps try running the entire test suite?
>

Patch

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