# HG changeset patch # User Dan Villiom Podlaski Christiansen # Date 1301596229 -7200 # Node ID 22f0c50c29a65f0740445ade02975b14a79211ad # Parent 6f0b0a47938c67fd4818487aa7721dbff06904f0 subvertpy wrapper: handle NotImplementedError from Subvertpy on missing replay diff --git a/hgsubversion/svnwrap/subvertpy_wrapper.py b/hgsubversion/svnwrap/subvertpy_wrapper.py --- a/hgsubversion/svnwrap/subvertpy_wrapper.py +++ b/hgsubversion/svnwrap/subvertpy_wrapper.py @@ -417,9 +417,10 @@ class SubversionRepo(object): try: self.remote.replay(revision, oldestrev, AbstractEditor(editor)) - except SubversionException, e: #pragma: no cover + except (SubversionException, NotImplementedError), e: #pragma: no cover # can I depend on this number being constant? - if (e.args[1] == subvertpy.ERR_RA_NOT_IMPLEMENTED or + if (isinstance(e, NotImplementedError) or + e.args[1] == subvertpy.ERR_RA_NOT_IMPLEMENTED or e.args[1] == subvertpy.ERR_UNSUPPORTED_FEATURE): msg = ('This Subversion server is older than 1.4.0, and ' 'cannot satisfy replay requests.')