# HG changeset patch # User Pierre-Yves David # Date 1343233118 -7200 # Node ID 881c3eca314acc855516460f87c3f81594f51a86 # Parent 0313cb49fa1a122c25050037cf7ff9f26c557714 Wider triggering of the debug marker abort diff -r 0313cb49fa1a -r 881c3eca314a 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.')