diff hgext/convert/subversion.py @ 13494:3178aca36b0f stable

convert.svn: branch name which equals trunk means `default' branch (issue2653) Converting from subversion specifying config.svn.trunk results in storing trunk under branch named as config.svn.trunk, where `default' brunch is expected. Submission contains patch and test.
author Pavel Boldin <boldin.pavel@gmail.com>
date Fri, 25 Feb 2011 21:01:30 +0300
parents 69418d4525d1
children 9b62cbe81f44 9777df929035
line wrap: on
line diff
--- a/hgext/convert/subversion.py	Fri Feb 25 23:26:24 2011 -0600
+++ b/hgext/convert/subversion.py	Fri Feb 25 21:01:30 2011 +0300
@@ -311,6 +311,9 @@
                 return None
             path = (cfgpath or name).strip('/')
             if not self.exists(path, rev):
+                if self.module.endswith(path) and name == 'trunk':
+                    # we are converting from inside this directory
+                    return None
                 if cfgpath:
                     raise util.Abort(_('expected %s to be at %r, but not found')
                                  % (name, path))
@@ -758,7 +761,8 @@
             author = author and self.recode(author) or ''
             try:
                 branch = self.module.split("/")[-1]
-                if branch == 'trunk':
+                trunkname = self.ui.config('convert', 'svn.trunk', 'trunk')
+                if branch == trunkname.strip('/'):
                     branch = ''
             except IndexError:
                 branch = None