comparison hgsubversion/editor.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 9a6bb3657861
children ae572c9be4e6
comparison
equal deleted inserted replaced
1554:258fb67fb956 1555:cff81f35b31e
2 import sys 2 import sys
3 import tempfile 3 import tempfile
4 import shutil 4 import shutil
5 import os 5 import os
6 6
7 from mercurial import error as hgerror
7 from mercurial import util as hgutil 8 from mercurial import util as hgutil
8 from mercurial import revlog 9 from mercurial import revlog
9 from mercurial import node 10 from mercurial import node
10 11
11 import svnwrap 12 import svnwrap
573 target = svnwrap.SimpleStringIO(closing=False) 574 target = svnwrap.SimpleStringIO(closing=False)
574 self.stream = target 575 self.stream = target
575 576
576 handler = svnwrap.apply_txdelta(base, target) 577 handler = svnwrap.apply_txdelta(base, target)
577 if not callable(handler): # pragma: no cover 578 if not callable(handler): # pragma: no cover
578 raise hgutil.Abort('Error in Subversion bindings: ' 579 raise hgerror.Abort('Error in Subversion bindings: '
579 'cannot call handler!') 580 'cannot call handler!')
580 def txdelt_window(window): 581 def txdelt_window(window):
581 try: 582 try:
582 if not self.meta.is_path_valid(path): 583 if not self.meta.is_path_valid(path):
583 return 584 return
609 except svnwrap.SubversionException, e: # pragma: no cover 610 except svnwrap.SubversionException, e: # pragma: no cover
610 self.ui.traceback() 611 self.ui.traceback()
611 if e.args[1] == svnwrap.ERR_INCOMPLETE_DATA: 612 if e.args[1] == svnwrap.ERR_INCOMPLETE_DATA:
612 self.addmissing(path) 613 self.addmissing(path)
613 else: # pragma: no cover 614 else: # pragma: no cover
614 raise hgutil.Abort(*e.args) 615 raise hgerror.Abort(*e.args)
615 except: # pragma: no cover 616 except: # pragma: no cover
616 self._exception_info = sys.exc_info() 617 self._exception_info = sys.exc_info()
617 raise 618 raise
618 return txdelt_window 619 return txdelt_window
619 620