Patchwork [10,of,14] configitems: register the 'hgk.path' config

login
register
mail settings
Submitter Boris Feld
Date Oct. 6, 2017, 9:22 a.m.
Message ID <b8f74c4d188f9c581923.1507281746@FB>
Download mbox | patch
Permalink /patch/24591/
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 1498786955 -7200
#      Fri Jun 30 03:42:35 2017 +0200
# Node ID b8f74c4d188f9c581923c81635b048cd07a15cd4
# Parent  308aa280ed82cdd7ccb863053a7dacdc11c42987
# EXP-Topic config.register.hgk
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r b8f74c4d188f
configitems: register the 'hgk.path' config

Patch

diff -r 308aa280ed82 -r b8f74c4d188f hgext/hgk.py
--- a/hgext/hgk.py	Fri Jun 30 03:44:18 2017 +0200
+++ b/hgext/hgk.py	Fri Jun 30 03:42:35 2017 +0200
@@ -61,6 +61,13 @@ 
 # leave the attribute unspecified.
 testedwith = 'ships-with-hg-core'
 
+configtable = {}
+configitem = registrar.configitem(configtable)
+
+configitem('hgk', 'path',
+    default='hgk',
+)
+
 @command('debug-diff-tree',
     [('p', 'patch', None, _('generate patch')),
     ('r', 'recursive', None, _('recursive')),
@@ -346,6 +353,6 @@ 
     if repo.filtername is None:
         optstr += '--hidden'
 
-    cmd = ui.config("hgk", "path", "hgk") + " %s %s" % (optstr, " ".join(etc))
+    cmd = ui.config("hgk", "path") + " %s %s" % (optstr, " ".join(etc))
     ui.debug("running %s\n" % cmd)
     ui.system(cmd, blockedtag='hgk_view')