##// END OF EJS Templates
convert: svn: add function to get the latest revision touching a path...
Brendan Cully -
r4789:c5dd8e18 default
parent child Browse files
Show More
@@ -120,12 +120,7 b' class convert_svn(converter_source):'
120 except IOError, e:
120 except IOError, e:
121 pass
121 pass
122
122
123 if not latest:
123 self.last_changed = self.latest(self.module, latest)
124 latest = svn.ra.get_latest_revnum(self.ra)
125 dirent = svn.ra.stat(self.ra, self.module, latest)
126 if not dirent:
127 raise util.Abort('module %s not found in revision %d' % (self.module, latest))
128 self.last_changed = dirent.created_rev
129
124
130 self.head = self.rev(self.last_changed)
125 self.head = self.rev(self.last_changed)
131
126
@@ -134,7 +129,23 b' class convert_svn(converter_source):'
134
129
135 def revnum(self, rev):
130 def revnum(self, rev):
136 return int(rev.split('@')[-1])
131 return int(rev.split('@')[-1])
137
132
133 def latest(self, path, revnum, stop=0):
134 'find the latest revision affecting path, up to stop'
135 if not stop:
136 stop = svn.ra.get_latest_revnum(self.ra)
137 try:
138 self.reparent('')
139 dirent = svn.ra.stat(self.ra, path.strip('/'), stop)
140 self.reparent(self.module)
141 except SubversionException:
142 dirent = None
143 if not dirent:
144 raise util.Abort('module %s not found up to revision %d' \
145 % (self.module, stop))
146
147 return dirent.created_rev
148
138 def get_blacklist(self):
149 def get_blacklist(self):
139 """Avoid certain revision numbers.
150 """Avoid certain revision numbers.
140 It is not uncommon for two nearby revisions to cancel each other
151 It is not uncommon for two nearby revisions to cancel each other
General Comments 0
You need to be logged in to leave comments. Login now