mq: drop the use of mq.queue.qparent in mq.queue.strip
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Wed, 25 Sep 2013 13:41:43 +0200
changeset 19818 f72b513ad234
parent 19817 e67786965af2
child 19819 f0fc4d5797e1
mq: drop the use of mq.queue.qparent in mq.queue.strip Same as in the previous changeset, rev is never `None`. We can just copy the two relevant lines in in `queue.strip`. This help having `queue.strip` independent from `queue`. One further step toward the extraction of `strip` in an independent extension. (As discussed in issue3824).
hgext/mq.py
--- a/hgext/mq.py	Wed Sep 25 14:10:34 2013 +0200
+++ b/hgext/mq.py	Wed Sep 25 13:41:43 2013 +0200
@@ -1111,7 +1111,9 @@
 
             if update:
                 checklocalchanges(repo, force=force)
-                urev = self.qparents(repo, revs[0])
+                urev, p2 = repo.changelog.parents(revs[0])
+                if p2 != nullid and p2 in [x.node for x in self.applied]:
+                    urev = p2
                 hg.clean(repo, urev)
                 repo.dirstate.write()