Show More
@@ -22,11 +22,10 b' class converter_source(object):' | |||||
22 | self.rev = rev |
|
22 | self.rev = rev | |
23 |
|
23 | |||
24 | self.encoding = 'utf-8' |
|
24 | self.encoding = 'utf-8' | |
25 | self.revmap = {} |
|
|||
26 |
|
25 | |||
27 | def setrevmap(self, revmap): |
|
26 | def setrevmap(self, revmap): | |
28 | """set the map of already-converted revisions""" |
|
27 | """set the map of already-converted revisions""" | |
29 | self.revmap = revmap |
|
28 | pass | |
30 |
|
29 | |||
31 | def getheads(self): |
|
30 | def getheads(self): | |
32 | """Return a list of this repository's heads""" |
|
31 | """Return a list of this repository's heads""" |
@@ -87,6 +87,8 b' class convert_svn(converter_source):' | |||||
87 | raise NoRepo(msg) |
|
87 | raise NoRepo(msg) | |
88 |
|
88 | |||
89 | self.encoding = locale.getpreferredencoding() |
|
89 | self.encoding = locale.getpreferredencoding() | |
|
90 | self.lastrevs = {} | |||
|
91 | ||||
90 | latest = None |
|
92 | latest = None | |
91 | if rev: |
|
93 | if rev: | |
92 | try: |
|
94 | try: | |
@@ -455,13 +457,21 b' class convert_svn(converter_source):' | |||||
455 | receivelog) |
|
457 | receivelog) | |
456 | for entry in received: |
|
458 | for entry in received: | |
457 | parselogentry(*entry) |
|
459 | parselogentry(*entry) | |
458 | self.last_revnum = to_revnum |
|
|||
459 | except SubversionException, (_, num): |
|
460 | except SubversionException, (_, num): | |
460 | if num == svn.core.SVN_ERR_FS_NO_SUCH_REVISION: |
|
461 | if num == svn.core.SVN_ERR_FS_NO_SUCH_REVISION: | |
461 | raise NoSuchRevision(branch=self, |
|
462 | raise NoSuchRevision(branch=self, | |
462 | revision="Revision number %d" % to_revnum) |
|
463 | revision="Revision number %d" % to_revnum) | |
463 | raise |
|
464 | raise | |
464 |
|
465 | |||
|
466 | def setrevmap(self, revmap): | |||
|
467 | lastrevs = {} | |||
|
468 | for revid in revmap.keys(): | |||
|
469 | uuid, module, revnum = self.revsplit(revid) | |||
|
470 | lastrevnum = lastrevs.setdefault(module, revnum) | |||
|
471 | if revnum > lastrevnum: | |||
|
472 | lastrevs[module] = revnum | |||
|
473 | self.lastrevs = lastrevs | |||
|
474 | ||||
465 | def getheads(self): |
|
475 | def getheads(self): | |
466 | # detect standard /branches, /tags, /trunk layout |
|
476 | # detect standard /branches, /tags, /trunk layout | |
467 | optrev = svn.core.svn_opt_revision_t() |
|
477 | optrev = svn.core.svn_opt_revision_t() | |
@@ -532,7 +542,8 b' class convert_svn(converter_source):' | |||||
532 | uuid, module, revnum = self.revsplit(rev) |
|
542 | uuid, module, revnum = self.revsplit(rev) | |
533 | self.module = module |
|
543 | self.module = module | |
534 | self.reparent(module) |
|
544 | self.reparent(module) | |
535 | self._fetch_revisions(from_revnum=revnum, to_revnum=0) |
|
545 | stop = self.lastrevs.get(module, 0) | |
|
546 | self._fetch_revisions(from_revnum=revnum, to_revnum=stop) | |||
536 | return self.commits[rev] |
|
547 | return self.commits[rev] | |
537 |
|
548 | |||
538 | def gettags(self): |
|
549 | def gettags(self): |
General Comments 0
You need to be logged in to leave comments.
Login now