Anonymous committed 5c5e13b

Add "trunkbranch" config option to map SVN trunk to something else than the
default branch.

  • Participants
  • Parent commits 4bbc6bf
  • Branches pymigr

Comments (0)

Files changed (2)

File hgsubversion/help/subversion.rst

     Path to a file for changing branch names during the conversion from
     Subversion to Mercurial.
+  ``hgsubversion.trunkbranch``
+    Name of the Mercurial branch Subversion trunk changesets must belong to
+    or, if unspecified, ``default``. Useful if you set your branchmap for the
+    ``default`` branch to come from another Subversion branch.
     Path to a file for filtering files during the conversion. Files may either

File hgsubversion/

                                                  'usebranchnames', True)
         branchmap = self.ui.config('hgsubversion', 'branchmap')
         tagmap = self.ui.config('hgsubversion', 'tagmap')
+        self.trunkbranch = self.ui.config('hgsubversion', 'trunkbranch', None)
         self.branches = {}
         if os.path.exists(self.branch_info_file):
         if self.layout == 'single':
             return 'default'
         if path == 'trunk':
-            return None
+            return self.trunkbranch
         elif path.startswith('branches/'):
             return path[len('branches/'):]
         return  '../%s' % path
     def remotename(self, branch):
         if self.layout == 'single':
             return ''
-        if branch == 'default' or branch is None:
+        if branch in ('default', self.trunkbranch, None):
             return 'trunk'
         elif branch.startswith('../'):
             return branch[3:]
                 return None, None
             branch_created_rev = self.branches[branch][2]
             if parent_branch == 'trunk':
-                parent_branch = None
+                parent_branch = self.trunkbranch
             if branch_created_rev <= number+1 and branch != parent_branch:
                 # did the branch exist in previous run
                 if exact and branch in self.prevbranches: