[PATCH 6 of 9 standalone-strip] mq: drop the use of mq.queue.qparent in mq.strip

pierre-yves.david at ens-lyon.org pierre-yves.david at ens-lyon.org
Wed Sep 25 16:26:49 CDT 2013


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
# Date 1380111034 -7200
#      Wed Sep 25 14:10:34 2013 +0200
# Node ID 239e85092f78362cf095d3cd5285aa9df80f22c3
# Parent  afc02cb343a84c3d4cc170f14a434e82af1e1339
mq: drop the use of mq.queue.qparent in mq.strip

In this case, rev is never `None`. We can just copy the two relevant lines in
in `strip`. This help having `strip` independent from `queue` one
further step toward its extraction in an independent extension. (As
discussed in issue3824).

diff --git a/hgext/mq.py b/hgext/mq.py
--- a/hgext/mq.py
+++ b/hgext/mq.py
@@ -3060,11 +3060,13 @@ def strip(ui, repo, *revs, **opts):
 
     revs = sorted(rootnodes)
     if update and opts.get('keep'):
         wlock = repo.wlock()
         try:
-            urev = repo.mq.qparents(repo, revs[0])
+            urev, p2 = repo.changelog.parents(revs[0])
+            if p2 != nullid and p2 in [x.node for x in repo.mq.applied]:
+                urev = p2
             uctx = repo[urev]
 
             # only reset the dirstate for files that would actually change
             # between the working context and uctx
             descendantrevs = repo.revs("%s::." % uctx.rev())


More information about the Mercurial-devel mailing list