##// END OF EJS Templates
convert svn: try to extract URL from source if it is a working directory
Brendan Cully -
r5010:6b2d8caf default
parent child Browse files
Show More
@@ -28,15 +28,21 from common import NoRepo, commit, conve
28
28
29 try:
29 try:
30 from svn.core import SubversionException, Pool
30 from svn.core import SubversionException, Pool
31 import svn
32 import svn.client
31 import svn.core
33 import svn.core
32 import svn.ra
34 import svn.ra
33 import svn.delta
35 import svn.delta
34 import svn
35 import transport
36 import transport
36 except ImportError:
37 except ImportError:
37 pass
38 pass
38
39
39 def geturl(path):
40 def geturl(path):
41 try:
42 #extract URL from working directory
43 return svn.client.url_from_path(path)
44 except SubversionException:
45 pass
40 if os.path.isdir(path):
46 if os.path.isdir(path):
41 return 'file://%s' % os.path.normpath(os.path.abspath(path))
47 return 'file://%s' % os.path.normpath(os.path.abspath(path))
42 return path
48 return path
@@ -92,7 +98,7 class convert_svn(converter_source):
92 self.files = {}
98 self.files = {}
93 self.uuid = svn.ra.get_uuid(self.ra).decode(self.encoding)
99 self.uuid = svn.ra.get_uuid(self.ra).decode(self.encoding)
94 except SubversionException, e:
100 except SubversionException, e:
95 raise NoRepo("couldn't open SVN repo %s" % url)
101 raise NoRepo("couldn't open SVN repo %s" % self.url)
96
102
97 try:
103 try:
98 self.get_blacklist()
104 self.get_blacklist()
General Comments 0
You need to be logged in to leave comments. Login now