Show More
@@ -347,7 +347,7 b' class svn_source(converter_source):' | |||||
347 | % self.module) |
|
347 | % self.module) | |
348 | self.last_changed = self.revnum(self.head) |
|
348 | self.last_changed = self.revnum(self.head) | |
349 |
|
349 | |||
350 | self._changescache = None |
|
350 | self._changescache = (None, None) | |
351 |
|
351 | |||
352 | if os.path.exists(os.path.join(url, '.svn/entries')): |
|
352 | if os.path.exists(os.path.join(url, '.svn/entries')): | |
353 | self.wc = url |
|
353 | self.wc = url | |
@@ -444,10 +444,7 b' class svn_source(converter_source):' | |||||
444 |
|
444 | |||
445 | return self.heads |
|
445 | return self.heads | |
446 |
|
446 | |||
447 | def getchanges(self, rev): |
|
447 | def _getchanges(self, rev): | |
448 | if self._changescache and self._changescache[0] == rev: |
|
|||
449 | return self._changescache[1] |
|
|||
450 | self._changescache = None |
|
|||
451 | (paths, parents) = self.paths[rev] |
|
448 | (paths, parents) = self.paths[rev] | |
452 | if parents: |
|
449 | if parents: | |
453 | files, self.removed, copies = self.expandpaths(rev, paths, parents) |
|
450 | files, self.removed, copies = self.expandpaths(rev, paths, parents) | |
@@ -463,15 +460,23 b' class svn_source(converter_source):' | |||||
463 |
|
460 | |||
464 | files.sort() |
|
461 | files.sort() | |
465 | files = zip(files, [rev] * len(files)) |
|
462 | files = zip(files, [rev] * len(files)) | |
|
463 | return (files, copies) | |||
466 |
|
464 | |||
467 | # caller caches the result, so free it here to release memory |
|
465 | def getchanges(self, rev): | |
468 | del self.paths[rev] |
|
466 | # reuse cache from getchangedfiles | |
|
467 | if self._changescache[0] == rev: | |||
|
468 | (files, copies) = self._changescache[1] | |||
|
469 | else: | |||
|
470 | (files, copies) = self._getchanges(rev) | |||
|
471 | # caller caches the result, so free it here to release memory | |||
|
472 | del self.paths[rev] | |||
469 | return (files, copies) |
|
473 | return (files, copies) | |
470 |
|
474 | |||
471 | def getchangedfiles(self, rev, i): |
|
475 | def getchangedfiles(self, rev, i): | |
472 | changes = self.getchanges(rev) |
|
476 | # called from filemap - cache computed values for reuse in getchanges | |
473 | self._changescache = (rev, changes) |
|
477 | (files, copies) = self._getchanges(rev) | |
474 | return [f[0] for f in changes[0]] |
|
478 | self._changescache = (rev, (files, copies)) | |
|
479 | return [f[0] for f in files] | |||
475 |
|
480 | |||
476 | def getcommit(self, rev): |
|
481 | def getcommit(self, rev): | |
477 | if rev not in self.commits: |
|
482 | if rev not in self.commits: |
General Comments 0
You need to be logged in to leave comments.
Login now