changeset 1598:394007c5efea

hgsubversion: drop some more code which is for compat with hg<1.6
author Pulkit Goyal <pulkit@yandex-team.ru>
date Tue, 27 Nov 2018 14:04:08 +0300
parents b06be5815692
children 7bb6562feb85
files hgsubversion/__init__.py
diffstat 1 files changed, 8 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/hgsubversion/__init__.py
+++ b/hgsubversion/__init__.py
@@ -47,6 +47,7 @@ except (ImportError, AttributeError):
         'svn.ra',
     }
 
+from mercurial import discovery
 from mercurial import revset
 from mercurial import subrepo
 
@@ -101,26 +102,13 @@ wrapcmds = { # cmd: generic, target, fix
     ]),
 }
 
-try:
-    from mercurial import discovery
-    def findcommonoutgoing(orig, *args, **opts):
-        capable = getattr(args[1], 'capable', lambda x: False)
-        if capable('subversion'):
-            return wrappers.findcommonoutgoing(*args, **opts)
-        else:
-            return orig(*args, **opts)
-    extensions.wrapfunction(discovery, 'findcommonoutgoing', findcommonoutgoing)
-except AttributeError:
-    # only need the discovery variant of this code when we drop hg < 1.6
-    def findoutgoing(orig, *args, **opts):
-        capable = getattr(args[1], 'capable', lambda x: False)
-        if capable('subversion'):
-            return wrappers.findoutgoing(*args, **opts)
-        else:
-            return orig(*args, **opts)
-    extensions.wrapfunction(discovery, 'findoutgoing', findoutgoing)
-except ImportError:
-    pass
+def findcommonoutgoing(orig, *args, **opts):
+    capable = getattr(args[1], 'capable', lambda x: False)
+    if capable('subversion'):
+        return wrappers.findcommonoutgoing(*args, **opts)
+    else:
+        return orig(*args, **opts)
+extensions.wrapfunction(discovery, 'findcommonoutgoing', findcommonoutgoing)
 
 def extsetup(ui):
     """insert command wrappers for a bunch of commands"""