changeset 1138:c693541ee210

compat: drop compat code from hg < 1.9 (!!)
author Kevin Bullock <kbullock@ringworld.org>
date Wed, 07 Feb 2018 22:18:35 -0600
parents 633796ad1684
children 8e03a8ba04af
files hggit/__init__.py
diffstat 1 files changed, 1 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/hggit/__init__.py	Wed Feb 07 22:08:14 2018 -0600
+++ b/hggit/__init__.py	Wed Feb 07 22:18:35 2018 -0600
@@ -106,18 +106,6 @@
 # support for `hg clone localgitrepo`
 _oldlocal = hg.schemes['file']
 
-# COMPAT: hg 1.9 - url.url class moved into util module
-try:
-    urlcls = hgutil.url
-except AttributeError:
-    class urlcls(object):
-        def __init__(self, path):
-            self.p = hgutil.drop_scheme('file', path)
-
-        def localpath(self):
-            return self.p
-
-
 def _isgitdir(path):
     """True if the given file path is a git repo."""
     if os.path.exists(os.path.join(path, '.hg')):
@@ -137,7 +125,7 @@
 
 
 def _local(path):
-    p = urlcls(path).localpath()
+    p = hgutil.url(path).localpath()
     if _isgitdir(p):
         return gitrepo
     # detect git ssh urls (which mercurial thinks is a file-like path)