mq: slightly simplify check for patched working copy
authorMartin von Zweigbergk <martinvonz@google.com>
Thu, 24 Jan 2019 16:30:30 -0800
changeset 41395 b5f5dc0fa908
parent 41394 390ef056081b
child 41396 d75fde22de91
mq: slightly simplify check for patched working copy Differential Revision: https://phab.mercurial-scm.org/D5693
hgext/mq.py
--- a/hgext/mq.py	Thu Jan 24 16:25:19 2019 -0800
+++ b/hgext/mq.py	Thu Jan 24 16:30:30 2019 -0800
@@ -3521,7 +3521,7 @@
             if self.mq.applied and self.mq.checkapplied and not force:
                 parents = self.dirstate.parents()
                 patches = [s.node for s in self.mq.applied]
-                if parents[0] in patches or parents[1] in patches:
+                if any(p in patches for p in parents):
                     raise error.Abort(errmsg)
 
         def commit(self, text="", user=None, date=None, match=None,