# HG changeset patch # User Matt Mackall # Date 2013-11-15 03:37:18 # Node ID 2802bedbd45faccd7f8840774e70cf92337a5a11 # Parent 22154ec6fb8b7bba40f609b43c89cb00957fc322 strip: fix last unprotected mq reference (issue4097) diff --git a/hgext/strip.py b/hgext/strip.py --- a/hgext/strip.py +++ b/hgext/strip.py @@ -51,7 +51,9 @@ def strip(ui, repo, revs, update=True, b if update: checklocalchanges(repo, force=force) 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 hg.clean(repo, urev) repo.dirstate.write()