hgext/convert/convcmd.py
changeset 5934 e495f3f35b2d
parent 5621 badbefa55972
child 5959 0162c6cc045e
child 6099 37cc79a5727a
--- a/hgext/convert/convcmd.py	Tue Jan 22 00:16:50 2008 +0100
+++ b/hgext/convert/convcmd.py	Sat Jan 26 19:55:04 2008 +0100
@@ -222,15 +222,14 @@
             self.mapentry(rev, dest)
             return
         files, copies = changes
-        parents = [self.map[r] for r in commit.parents]
+        pbranches = []
         if commit.parents:
-            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)
+            for prev in commit.parents:
+                if prev not in self.commitcache:
+                    self.cachecommit(prev)
+                pbranches.append((self.map[prev], 
+                                  self.commitcache[prev].branch))
+        self.dest.setbranch(commit.branch, pbranches)
         for f, v in files:
             filenames.append(f)
             try:
@@ -246,6 +245,7 @@
                         # Merely marks that a copy happened.
                         self.dest.copyfile(copyf, f)
 
+        parents = [b[0] for b in pbranches]
         newnode = self.dest.putcommit(filenames, parents, commit)
         self.mapentry(rev, newnode)