# HG changeset patch # User Brendan Cully # Date 2007-07-26 17:57:26 # Node ID 6b2d8caf87b20cb79f22026658da330e22963d02 # Parent 30570c2f576fa2e2ead1212e1509886368453107 convert svn: try to extract URL from source if it is a working directory diff --git a/hgext/convert/subversion.py b/hgext/convert/subversion.py --- a/hgext/convert/subversion.py +++ b/hgext/convert/subversion.py @@ -28,15 +28,21 @@ 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: + #extract URL from working directory + return svn.client.url_from_path(path) + except SubversionException: + pass if os.path.isdir(path): return 'file://%s' % os.path.normpath(os.path.abspath(path)) return path @@ -92,7 +98,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()