hgext/convert/convcmd.py
branchstable
changeset 20331 1d155582a8ea
parent 19889 3828b3e09462
child 20374 a3545c3104aa
--- a/hgext/convert/convcmd.py	Mon Jan 27 10:57:20 2014 +0100
+++ b/hgext/convert/convcmd.py	Tue Jan 28 14:00:23 2014 +1100
@@ -371,7 +371,12 @@
     def cachecommit(self, rev):
         commit = self.source.getcommit(rev)
         commit.author = self.authors.get(commit.author, commit.author)
-        commit.branch = self.branchmap.get(commit.branch, commit.branch)
+        # If commit.branch is None, this commit is coming from the source
+        # repository's default branch and destined for the default branch in the
+        # destination repository. For such commits, passing a literal "None"
+        # string to branchmap.get() below allows the user to map "None" to an
+        # alternate default branch in the destination repository.
+        commit.branch = self.branchmap.get(str(commit.branch), commit.branch)
         self.commitcache[rev] = commit
         return commit