diff hgext/convert/__init__.py @ 5172:6b4c332f241b

convert: hg: optionally create branches as clones If convert.hg.clonebranches is set, branches will be created as clones of their parent revisions. All clones will be subdirectories of the destination path.
author Brendan Cully <brendan@kublai.com>
date Wed, 15 Aug 2007 13:21:23 -0700
parents d4fa6bafc43a
children 33015dac5df5
line wrap: on
line diff
--- a/hgext/convert/__init__.py
+++ b/hgext/convert/__init__.py
@@ -194,6 +194,12 @@ class convert(object):
         filenames = []
 
         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
+        else:
+            pbranch = None
+        self.dest.setbranch(commit.branch, pbranch, parents)
         for f, v in files:
             newf = self.mapfile(f)
             if not newf:
@@ -213,7 +219,6 @@ class convert(object):
                             # Merely marks that a copy happened.
                             self.dest.copyfile(copyf, newf)
 
-        parents = [self.map[r] for r in commit.parents]
         newnode = self.dest.putcommit(filenames, parents, commit)
         self.mapentry(rev, newnode)