changeset 5875:f1504d3355bb

convert: fetch less revisions when looking for a branch parent
author Patrick Mezard <pmezard@gmail.com>
date Thu, 17 Jan 2008 23:46:56 +0100
parents 866aa7ae2612
children fb93c774dfff
files hgext/convert/subversion.py
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/convert/subversion.py	Thu Jan 17 23:46:56 2008 +0100
+++ b/hgext/convert/subversion.py	Thu Jan 17 23:46:56 2008 +0100
@@ -292,7 +292,15 @@
             uuid, module, revnum = self.revsplit(rev)
             self.module = module
             self.reparent(module)
+            # We assume that:
+            # - requests for revisions after "stop" come from the
+            # revision graph backward traversal. Cache all of them
+            # down to stop, they will be used eventually.
+            # - requests for revisions before "stop" come to get
+            # isolated branches parents. Just fetch what is needed.
             stop = self.lastrevs.get(module, 0)
+            if revnum < stop:
+                stop = revnum + 1
             self._fetch_revisions(revnum, stop)
         commit = self.commits[rev]
         # caller caches the result, so free it here to release memory