Wider triggering of the debug marker abort
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Wed, 25 Jul 2012 18:18:38 +0200
changeset 379 881c3eca314a
parent 378 0313cb49fa1a
child 380 b36b07ae21bc
Wider triggering of the debug marker abort
hgext/obsolete.py
--- a/hgext/obsolete.py	Wed Jul 25 18:09:11 2012 +0200
+++ b/hgext/obsolete.py	Wed Jul 25 18:18:38 2012 +0200
@@ -75,7 +75,7 @@
 
 """
 
-import os
+import os, sys
 try:
     from cStringIO import StringIO
 except ImportError:
@@ -819,12 +819,6 @@
         @util.propertycache
         def _obsoleteset(self):
             """the set of obsolete revision"""
-            data = repo.opener.tryread('obsolete-relations')
-            if not data:
-                data = repo.sopener.tryread('obsoletemarkers')
-            if data:
-                raise util.Abort('old format of obsolete marker detected!\n'
-                                 'run `hg debugconvertobsolete` once.')
             obs = set()
             nm = self.changelog.nodemap
             for prec in self.obsstore.precursors:
@@ -1033,3 +1027,13 @@
             return c
 
     repo.__class__ = obsoletingrepo
+    for arg in sys.argv:
+        if 'debugc' in arg:
+            break
+    else:
+        data = repo.opener.tryread('obsolete-relations')
+        if not data:
+            data = repo.sopener.tryread('obsoletemarkers')
+        if data:
+            raise util.Abort('old format of obsolete marker detected!\n'
+                             'run `hg debugconvertobsolete` once.')