# HG changeset patch # User Patrick Mezard # Date 1299187168 -3600 # Node ID 9b62cbe81f44842403d6830cedab74eddf8dcf4d # Parent 73bf872a91d89af8b44e1e16ee51dd7ea457969b convert/svn: read trunk name once, use None for default diff -r 73bf872a91d8 -r 9b62cbe81f44 hgext/convert/subversion.py --- a/hgext/convert/subversion.py Thu Mar 03 21:42:15 2011 +0100 +++ b/hgext/convert/subversion.py Thu Mar 03 22:19:28 2011 +0100 @@ -259,6 +259,7 @@ except ValueError: raise util.Abort(_('svn: revision %s is not an integer') % rev) + self.trunkname = self.ui.config('convert', 'svn.trunk', 'trunk').strip('/') self.startrev = self.ui.config('convert', 'svn.startrev', default=0) try: self.startrev = int(self.startrev) @@ -761,9 +762,8 @@ author = author and self.recode(author) or '' try: branch = self.module.split("/")[-1] - trunkname = self.ui.config('convert', 'svn.trunk', 'trunk') - if branch == trunkname.strip('/'): - branch = '' + if branch == self.trunkname: + branch = None except IndexError: branch = None