mq: simplify qparents calculation
authorBenoit Boissinot <benoit.boissinot@ens-lyon.org>
Sun, 14 Mar 2010 01:01:17 +0100
changeset 10680 45eb9b5dacf6
parent 10679 35abaea778dc
child 10681 3f6a6407a3c7
mq: simplify qparents calculation
hgext/mq.py
--- a/hgext/mq.py	Sun Mar 14 00:53:55 2010 +0100
+++ b/hgext/mq.py	Sun Mar 14 01:01:17 2010 +0100
@@ -552,12 +552,8 @@
                 return None
             return self.applied[-1].node
         p1, p2 = repo.changelog.parents(rev)
-        if p2 != nullid:
-            arevs = [x.node for x in self.applied]
-            if p1 in arevs:
-                return p1
-            if p2 in arevs:
-                return p2
+        if p2 != nullid and p2 in [x.node for x in self.applied]:
+            return p2
         return p1
 
     def mergepatch(self, repo, mergeq, series, diffopts):