Merge with bos
authorBrendan Cully <brendan@kublai.com>
Thu, 26 Jul 2007 14:04:48 -0700
changeset 5021 7628612b822c
parent 5020 780051cca03c (diff)
parent 5019 e6cc4d4f5a81 (current diff)
child 5022 6d1d97b09384
Merge with bos
--- a/hgext/convert/subversion.py
+++ b/hgext/convert/subversion.py
@@ -28,15 +28,20 @@ from common import NoRepo, commit, conve
 
 try:
     from svn.core import SubversionException, Pool
+    import svn
+    import svn.client
     import svn.core
     import svn.ra
     import svn.delta
-    import svn
     import transport
 except ImportError:
     pass
 
 def geturl(path):
+    try:
+        return svn.client.url_from_path(svn.core.svn_path_canonicalize(path))
+    except SubversionException:
+        pass
     if os.path.isdir(path):
         return 'file://%s' % os.path.normpath(os.path.abspath(path))
     return path
@@ -92,7 +97,7 @@ class convert_svn(converter_source):
             self.files = {}
             self.uuid = svn.ra.get_uuid(self.ra).decode(self.encoding)
         except SubversionException, e:
-            raise NoRepo("couldn't open SVN repo %s" % url)
+            raise NoRepo("couldn't open SVN repo %s" % self.url)
 
         try:
             self.get_blacklist()