diff -r d51c658d3f04 -r 56b2bcea2529 mercurial/obsolete.py --- a/mercurial/obsolete.py Mon Oct 05 22:49:24 2015 -0700 +++ b/mercurial/obsolete.py Thu Oct 08 12:55:45 2015 -0700 @@ -68,7 +68,7 @@ """ import errno, struct -import util, base85, node, parsers +import util, base85, node, parsers, error import phases from i18n import _ @@ -164,7 +164,7 @@ # (metadata will be decoded on demand) metadata = data[off:off + mdsize] if len(metadata) != mdsize: - raise util.Abort(_('parsing obsolete marker: metadata is too ' + raise error.Abort(_('parsing obsolete marker: metadata is too ' 'short, %d bytes expected, got %d') % (mdsize, len(metadata))) off += mdsize @@ -200,7 +200,7 @@ def _fm0encodeonemarker(marker): pre, sucs, flags, metadata, date, parents = marker if flags & usingsha256: - raise util.Abort(_('cannot handle sha256 with old obsstore format')) + raise error.Abort(_('cannot handle sha256 with old obsstore format')) metadata = dict(metadata) time, tz = date metadata['date'] = '%r %i' % (time, tz) @@ -414,7 +414,7 @@ diskversion = _unpack('>B', data[off:off + 1])[0] off += 1 if diskversion not in formats: - raise util.Abort(_('parsing obsolete marker: unknown version %r') + raise error.Abort(_('parsing obsolete marker: unknown version %r') % diskversion) return diskversion, formats[diskversion][0](data, off) @@ -496,7 +496,7 @@ """ for mark in markers: if node.nullid in mark[1]: - raise util.Abort(_('bad obsolescence marker detected: ' + raise error.Abort(_('bad obsolescence marker detected: ' 'invalid successors nullid')) class obsstore(object): @@ -583,8 +583,8 @@ Take care of filtering duplicate. Return the number of new marker.""" if self._readonly: - raise util.Abort('creating obsolete markers is not enabled on this ' - 'repo') + raise error.Abort('creating obsolete markers is not enabled on ' + 'this repo') known = set(self._all) new = [] for m in markers: @@ -1217,7 +1217,7 @@ localmetadata.update(rel[2]) if not prec.mutable(): - raise util.Abort("cannot obsolete public changeset: %s" + raise error.Abort("cannot obsolete public changeset: %s" % prec, hint='see "hg help phases" for details') nprec = prec.node() @@ -1226,7 +1226,7 @@ if not nsucs: npare = tuple(p.node() for p in prec.parents()) if nprec in nsucs: - raise util.Abort("changeset %s cannot obsolete itself" % prec) + raise error.Abort("changeset %s cannot obsolete itself" % prec) repo.obsstore.create(tr, nprec, nsucs, flag, parents=npare, date=date, metadata=localmetadata) repo.filteredrevcache.clear() @@ -1250,7 +1250,7 @@ # createmarkers must be enabled if other options are enabled if ((allowunstableopt in result or exchangeopt in result) and not createmarkersopt in result): - raise util.Abort(_("'createmarkers' obsolete option must be enabled " + raise error.Abort(_("'createmarkers' obsolete option must be enabled " "if other obsolete options are enabled")) return option in result