Show More
@@ -27,7 +27,7 b' except ImportError:' | |||
|
27 | 27 | |
|
28 | 28 | class CompatibilityException(Exception): pass |
|
29 | 29 | |
|
30 | nbRevisionsPerFetch = 50 | |
|
30 | LOG_BATCH_SIZE = 50 | |
|
31 | 31 | |
|
32 | 32 | class svn_entry(object): |
|
33 | 33 | """Emulate a Subversion path change.""" |
@@ -127,9 +127,6 b' class convert_svn(converter_source):' | |||
|
127 | 127 | |
|
128 | 128 | self.head = self.rev(self.last_changed) |
|
129 | 129 | |
|
130 | # Should lazily fetch revisions in batches of, say, 1,000...: | |
|
131 | self._fetch_revisions(from_revnum=self.last_changed, to_revnum=0) | |
|
132 | ||
|
133 | 130 | def rev(self, revnum): |
|
134 | 131 | return (u"svn:%s%s@%s" % (self.uuid, self.module, revnum)).decode(self.encoding) |
|
135 | 132 | |
@@ -158,9 +155,12 b' class convert_svn(converter_source):' | |||
|
158 | 155 | svn.ra.reparent(self.ra, svn_url.encode(self.encoding)) |
|
159 | 156 | |
|
160 | 157 | def _fetch_revisions(self, from_revnum = 0, to_revnum = 347, pb=None): |
|
161 | self.parent_cset = None | |
|
162 |
self.child_ |
|
|
163 | ||
|
158 | if not hasattr(self, 'child_rev'): | |
|
159 | self.child_rev = from_revnum | |
|
160 | self.child_cset = self.commits.get(self.child_rev) | |
|
161 | else: | |
|
162 | self.commits[self.child_rev] = self.child_cset | |
|
163 | ||
|
164 | 164 | self.ui.debug('Fetching revisions %d to %d\n' % (from_revnum, to_revnum)) |
|
165 | 165 | |
|
166 | 166 | def get_entry_from_path(path, module=self.module): |
@@ -388,18 +388,17 b' class convert_svn(converter_source):' | |||
|
388 | 388 | author = author and self.recode(author) or '' |
|
389 | 389 | |
|
390 | 390 | cset = commit(author=author, |
|
391 | date=util.datestr(date), | |
|
392 | desc=log, | |
|
393 | parents=[], | |
|
394 | copies=copies, | |
|
395 | branch=branch) | |
|
391 | date=util.datestr(date), | |
|
392 | desc=log, | |
|
393 | parents=[], | |
|
394 | copies=copies, | |
|
395 | branch=branch) | |
|
396 | 396 | |
|
397 |
if self.child_cset |
|
|
397 | if self.child_cset and self.child_rev != rev: | |
|
398 | 398 | self.child_cset.parents = [rev] |
|
399 | ||
|
399 | self.commits[self.child_rev] = self.child_cset | |
|
400 | 400 | self.child_cset = cset |
|
401 | ||
|
402 | self.commits[rev] = cset | |
|
401 | self.child_rev = rev | |
|
403 | 402 | |
|
404 | 403 | try: |
|
405 | 404 | discover_changed_paths = True |
@@ -465,6 +464,10 b' class convert_svn(converter_source):' | |||
|
465 | 464 | return cl |
|
466 | 465 | |
|
467 | 466 | def getcommit(self, rev): |
|
467 | if rev not in self.commits: | |
|
468 | revnum = int(rev.split('@')[-1]) | |
|
469 | minrev = revnum - LOG_BATCH_SIZE > 0 and revnum - LOG_BATCH_SIZE or 0 | |
|
470 | self._fetch_revisions(from_revnum=revnum, to_revnum=minrev) | |
|
468 | 471 | return self.commits[rev] |
|
469 | 472 | |
|
470 | 473 | def gettags(self): |
General Comments 0
You need to be logged in to leave comments.
Login now