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