Mercurial > hgsubversion
comparison 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 |
comparison
equal
deleted
inserted
replaced
1554:258fb67fb956 | 1555:cff81f35b31e |
---|---|
9 from mercurial import exchange | 9 from mercurial import exchange |
10 exchange.push # existed in first iteration of this file | 10 exchange.push # existed in first iteration of this file |
11 except ImportError: | 11 except ImportError: |
12 # We only *use* the exchange module in hg 3.2+, so this is safe | 12 # We only *use* the exchange module in hg 3.2+, so this is safe |
13 pass | 13 pass |
14 from mercurial import error as hgerror | |
14 from mercurial import patch | 15 from mercurial import patch |
15 from mercurial import hg | 16 from mercurial import hg |
16 from mercurial import util as hgutil | 17 from mercurial import util as hgutil |
17 from mercurial import node | 18 from mercurial import node |
18 from mercurial import i18n | 19 from mercurial import i18n |
66 return orig(ui, repo, *args, **opts) | 67 return orig(ui, repo, *args, **opts) |
67 meta = repo.svnmeta() | 68 meta = repo.svnmeta() |
68 hashes = meta.revmap.hashes() | 69 hashes = meta.revmap.hashes() |
69 ha = util.parentrev(ui, repo, meta, hashes) | 70 ha = util.parentrev(ui, repo, meta, hashes) |
70 if ha.node() == node.nullid: | 71 if ha.node() == node.nullid: |
71 raise hgutil.Abort('No parent svn revision!') | 72 raise hgerror.Abort('No parent svn revision!') |
72 displayer = cmdutil.show_changeset(ui, repo, opts, buffered=False) | 73 displayer = cmdutil.show_changeset(ui, repo, opts, buffered=False) |
73 displayer.show(ha) | 74 displayer.show(ha) |
74 return 0 | 75 return 0 |
75 | 76 |
76 | 77 |
430 | 431 |
431 if meta.branch: | 432 if meta.branch: |
432 if meta.layout != 'single': | 433 if meta.layout != 'single': |
433 msg = ('branch cannot be specified for Subversion clones using ' | 434 msg = ('branch cannot be specified for Subversion clones using ' |
434 'standard directory layout') | 435 'standard directory layout') |
435 raise hgutil.Abort(msg) | 436 raise hgerror.Abort(msg) |
436 | 437 |
437 meta.branchmap['default'] = meta.branch | 438 meta.branchmap['default'] = meta.branch |
438 | 439 |
439 ui = repo.ui | 440 ui = repo.ui |
440 start = meta.revmap.lastpulled | 441 start = meta.revmap.lastpulled |
444 start = util.parse_revnum(svn, repo.ui.config('hgsubversion', | 445 start = util.parse_revnum(svn, repo.ui.config('hgsubversion', |
445 'startrev', 0)) | 446 'startrev', 0)) |
446 | 447 |
447 if start > 0: | 448 if start > 0: |
448 if meta.layout == 'standard': | 449 if meta.layout == 'standard': |
449 raise hgutil.Abort('non-zero start revisions are only ' | 450 raise hgerror.Abort('non-zero start revisions are only ' |
450 'supported for single-directory clones.') | 451 'supported for single-directory clones.') |
451 ui.note('starting at revision %d; any prior will be ignored\n' | 452 ui.note('starting at revision %d; any prior will be ignored\n' |
452 % start) | 453 % start) |
453 # fetch all revisions *including* the one specified... | 454 # fetch all revisions *including* the one specified... |
454 start -= 1 | 455 start -= 1 |
516 and tries < 3): | 517 and tries < 3): |
517 tries += 1 | 518 tries += 1 |
518 ui.status('Got a 502, retrying (%s)\n' % tries) | 519 ui.status('Got a 502, retrying (%s)\n' % tries) |
519 else: | 520 else: |
520 ui.traceback() | 521 ui.traceback() |
521 raise hgutil.Abort(*e.args) | 522 raise hgerror.Abort(*e.args) |
522 | 523 |
523 lastpulled = r.revnum | 524 lastpulled = r.revnum |
524 | 525 |
525 except KeyboardInterrupt: | 526 except KeyboardInterrupt: |
526 ui.traceback() | 527 ui.traceback() |