Mercurial > hgsubversion
comparison hgsubversion/__init__.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 | 601eaa89ca98 |
children | ae572c9be4e6 |
comparison
equal
deleted
inserted
replaced
1554:258fb67fb956 | 1555:cff81f35b31e |
---|---|
26 from mercurial import exchange | 26 from mercurial import exchange |
27 exchange.push # existed in first iteration of this file | 27 exchange.push # existed in first iteration of this file |
28 except ImportError: | 28 except ImportError: |
29 # We only *use* the exchange module in hg 3.2+, so this is safe | 29 # We only *use* the exchange module in hg 3.2+, so this is safe |
30 pass | 30 pass |
31 from mercurial import error as hgerror | |
31 from mercurial import extensions | 32 from mercurial import extensions |
32 from mercurial import help | 33 from mercurial import help |
33 from mercurial import hg | 34 from mercurial import hg |
34 from mercurial import localrepo | 35 from mercurial import localrepo |
35 from mercurial import util as hgutil | 36 from mercurial import util as hgutil |
347 elif kw == 'svnpath': | 348 elif kw == 'svnpath': |
348 return convertinfo[40:].rsplit('@', 1)[0] | 349 return convertinfo[40:].rsplit('@', 1)[0] |
349 elif kw == 'svnrev': | 350 elif kw == 'svnrev': |
350 return convertinfo[40:].rsplit('@', 1)[-1] | 351 return convertinfo[40:].rsplit('@', 1)[-1] |
351 else: | 352 else: |
352 raise hgutil.Abort('unrecognized hgsubversion keyword %s' % kw) | 353 raise hgerror.Abort('unrecognized hgsubversion keyword %s' % kw) |
353 | 354 |
354 @templatekeyword('svnrev') | 355 @templatekeyword('svnrev') |
355 def svnrevkw(**args): | 356 def svnrevkw(**args): |
356 """:svnrev: String. Converted subversion revision number.""" | 357 """:svnrev: String. Converted subversion revision number.""" |
357 return _templatehelper(args['ctx'], 'svnrev') | 358 return _templatehelper(args['ctx'], 'svnrev') |