diff hgsubversion/wrappers.py @ 1555:cff81f35b31e

cleanup: reference Abort from mercurial.error instead of mercurial.util It's been there since hg 1.7 or so, which lets us avoid any need for compat shims.
author Augie Fackler <raf@durin42.com>
date Sat, 24 Mar 2018 16:39:30 -0400
parents 22137e94411f
children dd409375c261
line wrap: on
line diff
--- a/hgsubversion/wrappers.py
+++ b/hgsubversion/wrappers.py
@@ -11,6 +11,7 @@ try:
 except ImportError:
     # We only *use* the exchange module in hg 3.2+, so this is safe
     pass
+from mercurial import error as hgerror
 from mercurial import patch
 from mercurial import hg
 from mercurial import util as hgutil
@@ -68,7 +69,7 @@ def parents(orig, ui, repo, *args, **opt
     hashes = meta.revmap.hashes()
     ha = util.parentrev(ui, repo, meta, hashes)
     if ha.node() == node.nullid:
-        raise hgutil.Abort('No parent svn revision!')
+        raise hgerror.Abort('No parent svn revision!')
     displayer = cmdutil.show_changeset(ui, repo, opts, buffered=False)
     displayer.show(ha)
     return 0
@@ -432,7 +433,7 @@ def pull(repo, source, heads=[], force=F
             if meta.layout != 'single':
                 msg = ('branch cannot be specified for Subversion clones using '
                        'standard directory layout')
-                raise hgutil.Abort(msg)
+                raise hgerror.Abort(msg)
 
             meta.branchmap['default'] = meta.branch
 
@@ -446,7 +447,7 @@ def pull(repo, source, heads=[], force=F
 
             if start > 0:
                 if meta.layout == 'standard':
-                    raise hgutil.Abort('non-zero start revisions are only '
+                    raise hgerror.Abort('non-zero start revisions are only '
                                        'supported for single-directory clones.')
                 ui.note('starting at revision %d; any prior will be ignored\n'
                         % start)
@@ -518,7 +519,7 @@ def pull(repo, source, heads=[], force=F
                             ui.status('Got a 502, retrying (%s)\n' % tries)
                         else:
                             ui.traceback()
-                            raise hgutil.Abort(*e.args)
+                            raise hgerror.Abort(*e.args)
 
                 lastpulled = r.revnum