changeset 383:61865ad88740

compatibility with new url handling in Mercurial 1.9
author Mads Kiilerich <mads@kiilerich.com>
date Tue, 05 Apr 2011 13:31:28 +0200
parents f55869b556f0
children fc37cb795b51
files hggit/__init__.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hggit/__init__.py	Wed Mar 23 21:31:26 2011 -0500
+++ b/hggit/__init__.py	Tue Apr 05 13:31:28 2011 +0200
@@ -24,6 +24,7 @@
 from mercurial import hg
 from mercurial import localrepo
 from mercurial import util as hgutil
+from mercurial import url
 from mercurial.i18n import _
 
 demandimport.ignore.extend([
@@ -42,7 +43,10 @@
 _oldlocal = hg.schemes['file']
 
 def _local(path):
-    p = hgutil.drop_scheme('file', path)
+    try:
+        p = hgutil.drop_scheme('file', path)
+    except AttributeError:
+        p = url.url(path).localpath()
     if (os.path.exists(os.path.join(p, '.git')) and
         not os.path.exists(os.path.join(p, '.hg'))):
         return gitrepo