Patchwork [08,of,14] configitems: register the 'share.pool' config

login
register
mail settings
Submitter Boris Feld
Date Oct. 6, 2017, 9:22 a.m.
Message ID <f9734580f2b624dab3be.1507281744@FB>
Download mbox | patch
Permalink /patch/24588/
State Accepted
Headers show

Comments

Boris Feld - Oct. 6, 2017, 9:22 a.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1498787057 -7200
#      Fri Jun 30 03:44:17 2017 +0200
# Node ID f9734580f2b624dab3becb2e21ea3fa9bc137a83
# Parent  18cd210535b3d8dc1487a866f9e0553c4f1aa80e
# EXP-Topic config.register.share
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r f9734580f2b6
configitems: register the 'share.pool' config

Patch

diff -r 18cd210535b3 -r f9734580f2b6 hgext/share.py
--- a/hgext/share.py	Fri Jun 30 03:44:19 2017 +0200
+++ b/hgext/share.py	Fri Jun 30 03:44:17 2017 +0200
@@ -63,6 +63,13 @@ 
 # leave the attribute unspecified.
 testedwith = 'ships-with-hg-core'
 
+configtable = {}
+configitem = registrar.configitem(configtable)
+
+configitem('share', 'pool',
+    default=None,
+)
+
 @command('share',
     [('U', 'noupdate', None, _('do not create a working directory')),
      ('B', 'bookmarks', None, _('also share bookmarks')),
@@ -128,7 +135,7 @@ 
 
 # Wrap clone command to pass auto share options.
 def clone(orig, ui, source, *args, **opts):
-    pool = ui.config('share', 'pool', None)
+    pool = ui.config('share', 'pool')
     if pool:
         pool = util.expandpath(pool)