From patchwork Thu Sep 5 01:28:01 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [V2] mq: report the negative guard is match if the negative guarded patch is pushable From: elson.wei@gmail.com X-Patchwork-Id: 2331 Message-Id: <3418b76aeb5c2f220201.1378344481@ElsonWei-NB.PrimeVOLT> To: mercurial-devel@selenic.com Date: Thu, 05 Sep 2013 09:28:01 +0800 # HG changeset patch # User Wei, Elson # 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