Mercurial > hg
comparison hgext/convert/subversion.py @ 13530:5f69af0d2fb3
convert/svn: stop using svn bindings when pushing to svn
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Thu, 03 Mar 2011 22:41:38 +0100 |
parents | 9b62cbe81f44 |
children | 30a0e3519f69 |
comparison
equal
deleted
inserted
replaced
13529:9b62cbe81f44 | 13530:5f69af0d2fb3 |
---|---|
940 exit 1 | 940 exit 1 |
941 ''' | 941 ''' |
942 | 942 |
943 class svn_sink(converter_sink, commandline): | 943 class svn_sink(converter_sink, commandline): |
944 commit_re = re.compile(r'Committed revision (\d+).', re.M) | 944 commit_re = re.compile(r'Committed revision (\d+).', re.M) |
945 uuid_re = re.compile(r'Repository UUID:\s*(\S+)', re.M) | |
945 | 946 |
946 def prerun(self): | 947 def prerun(self): |
947 if self.wc: | 948 if self.wc: |
948 os.chdir(self.wc) | 949 os.chdir(self.wc) |
949 | 950 |
960 def authorfile(self): | 961 def authorfile(self): |
961 return self.join('hg-authormap') | 962 return self.join('hg-authormap') |
962 | 963 |
963 def __init__(self, ui, path): | 964 def __init__(self, ui, path): |
964 | 965 |
965 if svn is None: | |
966 raise MissingTool(_('Could not load Subversion python bindings')) | |
967 converter_sink.__init__(self, ui, path) | 966 converter_sink.__init__(self, ui, path) |
968 commandline.__init__(self, ui, 'svn') | 967 commandline.__init__(self, ui, 'svn') |
969 self.delete = [] | 968 self.delete = [] |
970 self.setexec = [] | 969 self.setexec = [] |
971 self.delexec = [] | 970 self.delexec = [] |
1008 fp = open(hook, 'w') | 1007 fp = open(hook, 'w') |
1009 fp.write(pre_revprop_change) | 1008 fp.write(pre_revprop_change) |
1010 fp.close() | 1009 fp.close() |
1011 util.set_flags(hook, False, True) | 1010 util.set_flags(hook, False, True) |
1012 | 1011 |
1013 xport = transport.SvnRaTransport(url=geturl(path)) | 1012 output = self.run0('info') |
1014 self.uuid = svn.ra.get_uuid(xport.ra) | 1013 self.uuid = self.uuid_re.search(output).group(1).strip() |
1015 | 1014 |
1016 def wjoin(self, *names): | 1015 def wjoin(self, *names): |
1017 return os.path.join(self.wc, *names) | 1016 return os.path.join(self.wc, *names) |
1018 | 1017 |
1019 def putfile(self, filename, flags, data): | 1018 def putfile(self, filename, flags, data): |