diff hgext/strip.py @ 20009:2802bedbd45f stable

strip: fix last unprotected mq reference (issue4097)
author Matt Mackall <mpm@selenic.com>
date Thu, 14 Nov 2013 21:37:18 -0600
parents 3d42a85f6922
children 88e172871ad7 6284b0b16033
line wrap: on
line diff
--- a/hgext/strip.py	Sat Nov 09 10:21:20 2013 +0100
+++ b/hgext/strip.py	Thu Nov 14 21:37:18 2013 -0600
@@ -51,7 +51,9 @@
         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()