convert: urlify svn repos if necessary.
authorBrendan Cully <brendan@kublai.com>
Thu, 26 Jul 2007 10:42:44 -0700
changeset 5008 b6c3abdbe0eb
parent 4998 81f8ff2a9bf2
child 5009 30570c2f576f
convert: urlify svn repos if necessary. We should also try to extract the URL from an svn working directory.
hgext/convert/subversion.py
--- a/hgext/convert/subversion.py	Wed Jul 25 15:58:10 2007 +0900
+++ b/hgext/convert/subversion.py	Thu Jul 26 10:42:44 2007 -0700
@@ -36,6 +36,11 @@
 except ImportError:
     pass
 
+def geturl(path):
+    if os.path.isdir(path):
+        return 'file://%s' % os.path.normpath(os.path.abspath(path))
+    return path
+
 class CompatibilityException(Exception): pass
 
 class changedpath(object):
@@ -74,10 +79,10 @@
                 url = url[:at]
         except ValueError, e:
             pass
-        self.url = url
+        self.url = geturl(url)
         self.encoding = 'UTF-8' # Subversion is always nominal UTF-8
         try:
-            self.transport = transport.SvnRaTransport(url=url)
+            self.transport = transport.SvnRaTransport(url=self.url)
             self.ra = self.transport.ra
             self.ctx = self.transport.client
             self.base = svn.ra.get_repos_root(self.ra)