changeset 388:bcc79fa3fe09

url wasn't ever published as url.url, and is now util.url
author Augie Fackler <durin42@gmail.com>
date Sun, 15 May 2011 12:26:03 -0500
parents ed28dd69df61
children 5fdff9b8e742
files hggit/__init__.py
diffstat 1 files changed, 11 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/hggit/__init__.py	Sun May 15 12:24:25 2011 -0500
+++ b/hggit/__init__.py	Sun May 15 12:26:03 2011 -0500
@@ -42,11 +42,18 @@
 # support for `hg clone localgitrepo`
 _oldlocal = hg.schemes['file']
 
+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 _local(path):
-    try:
-        p = hgutil.drop_scheme('file', path)
-    except AttributeError:
-        p = url.url(path).localpath()
+    p = urlcls(path).localpath()
     if (os.path.exists(os.path.join(p, '.git')) and
         not os.path.exists(os.path.join(p, '.hg'))):
         return gitrepo