# HG changeset patch # User Pierre-Yves David # Date 1380111411 -7200 # Node ID 8cf0e2c329013d71608a095c70e7487510638041 # Parent f0fc4d5797e1b12db6125bed48dcd3a76a6398ee mq: have the strip command functionnal on repo without mq This is the last step before being able to extract `strip` in its own extension. The changes are made in mq to allow a move only extraction without touching a line of code. diff -r f0fc4d5797e1 -r 8cf0e2c32901 hgext/mq.py --- a/hgext/mq.py Wed Sep 25 14:07:37 2013 +0200 +++ b/hgext/mq.py Wed Sep 25 14:16:51 2013 +0200 @@ -3042,8 +3042,8 @@ rootnodes = set(cl.node(r) for r in roots) - q = repo.mq - if q.applied: + q = getattr(repo, 'mq', None) + if q is not None and q.applied: # refresh queue state if we're about to strip # applied patches if cl.rev(repo.lookup('qtip')) in strippedrevs: @@ -3064,7 +3064,8 @@ wlock = repo.wlock() try: urev, p2 = repo.changelog.parents(revs[0]) - if p2 != nullid and p2 in [x.node for x in repo.mq.applied]: + if (util.safehasattr(repo, 'mq') and p2 != nullid + and p2 in [x.node for x in repo.mq.applied]): urev = p2 uctx = repo[urev]