hgext/shelve.py
changeset 19885 6cc696179869
parent 19881 821a89018f17
child 19887 dd7c294365f0
--- a/hgext/shelve.py	Mon Oct 07 11:45:01 2013 -0700
+++ b/hgext/shelve.py	Wed Oct 09 14:15:20 2013 -0700
@@ -156,11 +156,14 @@
         # check modified, added, removed, deleted only
         for flist in repo.status(match=match)[:4]:
             shelvedfiles.extend(flist)
-        saved, repo.mq.checkapplied = repo.mq.checkapplied, False
+        hasmq = util.safehasattr(repo, 'mq')
+        if hasmq:
+            saved, repo.mq.checkapplied = repo.mq.checkapplied, False
         try:
             return repo.commit(message, user, opts.get('date'), match)
         finally:
-            repo.mq.checkapplied = saved
+            if hasmq:
+                repo.mq.checkapplied = saved
 
     if parent.node() != nullid:
         desc = parent.description().split('\n', 1)[0]