Patchwork [27,of,27] configitems: register the 'convert.svn.trunk' config

login
register
mail settings
Submitter Boris Feld
Date Sept. 13, 2017, 6:59 a.m.
Message ID <35f747ae68c0c820c99e.1505285977@FB>
Download mbox | patch
Permalink /patch/23859/
State Accepted
Headers show

Comments

Boris Feld - Sept. 13, 2017, 6:59 a.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1498786614 -7200
#      ven. juin 30 03:36:54 2017 +0200
# Node ID 35f747ae68c0c820c99e6b3e574e79beccf631e1
# Parent  64be670052f552196c3a5dfb029f12fd6e54271b
# EXP-Topic config.register.convert
configitems: register the 'convert.svn.trunk' config

The strip is moved to its own line because the config checking script get
confused otherwise. Since the config registration should allow to deprecate most
of the script, I do not care much about fixing the script.

Patch

diff -r 64be670052f5 -r 35f747ae68c0 hgext/convert/__init__.py
--- a/hgext/convert/__init__.py	ven. juin 30 03:36:46 2017 +0200
+++ b/hgext/convert/__init__.py	ven. juin 30 03:36:54 2017 +0200
@@ -109,6 +109,9 @@ 
 configitem('convert', 'svn.startrev',
     default=0,
 )
+configitem('convert', 'svn.trunk',
+    default='trunk',
+)
 
 # Commands definition was moved elsewhere to ease demandload job.
 
diff -r 64be670052f5 -r 35f747ae68c0 hgext/convert/subversion.py
--- a/hgext/convert/subversion.py	ven. juin 30 03:36:46 2017 +0200
+++ b/hgext/convert/subversion.py	ven. juin 30 03:36:54 2017 +0200
@@ -352,8 +352,8 @@ 
                 raise error.Abort(_('svn: revision %s is not an integer') %
                                  revs[0])
 
-        self.trunkname = self.ui.config('convert', 'svn.trunk',
-                                        'trunk').strip('/')
+        self.trunkname = self.ui.config('convert', 'svn.trunk')
+        self.trunkname = self.trunkname.strip('/')
         self.startrev = self.ui.config('convert', 'svn.startrev')
         try:
             self.startrev = int(self.startrev)