changeset 5204:6f636d13f6b8

convert: load parent commits on-demand
author Patrick Mezard <pmezard@gmail.com>
date Sun, 19 Aug 2007 17:38:40 +0200
parents 653790c2fa52
children ce4e67533723
files hgext/convert/__init__.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/convert/__init__.py	Sun Aug 19 17:38:07 2007 +0200
+++ b/hgext/convert/__init__.py	Sun Aug 19 17:38:40 2007 +0200
@@ -201,7 +201,10 @@
         files, copies = self.source.getchanges(rev)
         parents = [self.map[r] for r in commit.parents]
         if commit.parents:
-            pbranch = self.commitcache[commit.parents[0]].branch
+            prev = commit.parents[0]
+            if prev not in self.commitcache:
+                self.cachecommit(prev)
+            pbranch = self.commitcache[prev].branch
         else:
             pbranch = None
         self.dest.setbranch(commit.branch, pbranch, parents)