##// END OF EJS Templates
convert: svn: add revnum() to convert rev to revnum
Brendan Cully -
r4774:d305852a default
parent child Browse files
Show More
@@ -132,6 +132,9 b' class convert_svn(converter_source):'
132 def rev(self, revnum):
132 def rev(self, revnum):
133 return (u"svn:%s%s@%s" % (self.uuid, self.module, revnum)).decode(self.encoding)
133 return (u"svn:%s%s@%s" % (self.uuid, self.module, revnum)).decode(self.encoding)
134
134
135 def revnum(self, rev):
136 return int(rev.split('@')[-1])
137
135 def get_blacklist(self):
138 def get_blacklist(self):
136 """Avoid certain revision numbers.
139 """Avoid certain revision numbers.
137 It is not uncommon for two nearby revisions to cancel each other
140 It is not uncommon for two nearby revisions to cancel each other
@@ -428,7 +431,7 b' class convert_svn(converter_source):'
428 # TODO: ra.get_file transmits the whole file instead of diffs.
431 # TODO: ra.get_file transmits the whole file instead of diffs.
429 mode = ''
432 mode = ''
430 try:
433 try:
431 revnum = int(rev.split("@")[-1])
434 revnum = self.revnum(rev)
432 if self.module != self.modulemap[revnum]:
435 if self.module != self.modulemap[revnum]:
433 self.module = self.modulemap[revnum]
436 self.module = self.modulemap[revnum]
434 self.reparent(self.module)
437 self.reparent(self.module)
@@ -467,7 +470,7 b' class convert_svn(converter_source):'
467
470
468 def getcommit(self, rev):
471 def getcommit(self, rev):
469 if rev not in self.commits:
472 if rev not in self.commits:
470 revnum = int(rev.split('@')[-1])
473 revnum = self.revnum(rev)
471 minrev = revnum - LOG_BATCH_SIZE > 0 and revnum - LOG_BATCH_SIZE or 0
474 minrev = revnum - LOG_BATCH_SIZE > 0 and revnum - LOG_BATCH_SIZE or 0
472 self._fetch_revisions(from_revnum=revnum, to_revnum=minrev)
475 self._fetch_revisions(from_revnum=revnum, to_revnum=minrev)
473 return self.commits[rev]
476 return self.commits[rev]
General Comments 0
You need to be logged in to leave comments. Login now