Comments
Patch
@@ -58,16 +58,21 @@
raise error.Abort(_("local changed subrepos found" + excsuffix))
return s
+def _findupdatetarget(repo, nodes):
+ unode, p2 = repo.changelog.parents(nodes[0])
+
+ if (util.safehasattr(repo, 'mq') and p2 != nullid
+ and p2 in [x.node for x in repo.mq.applied]):
+ unode = p2
+
+ return unode
+
def strip(ui, repo, revs, update=True, backup=True, force=None, bookmarks=None):
with repo.wlock(), repo.lock():
if update:
checklocalchanges(repo, force=force)
- urev, p2 = repo.changelog.parents(revs[0])
- if (util.safehasattr(repo, 'mq') and
- p2 != nullid
- and p2 in [x.node for x in repo.mq.applied]):
- urev = p2
+ urev = _findupdatetarget(repo, revs)
hg.clean(repo, urev)
repo.dirstate.write(repo.currenttransaction())
@@ -196,10 +201,7 @@
revs = sorted(rootnodes)
if update and opts.get('keep'):
- urev, p2 = repo.changelog.parents(revs[0])
- if (util.safehasattr(repo, 'mq') and p2 != nullid
- and p2 in [x.node for x in repo.mq.applied]):
- urev = p2
+ urev = _findupdatetarget(repo, revs)
uctx = repo[urev]
# only reset the dirstate for files that would actually change