# HG changeset patch # User Patrick Mezard # Date 1191616776 -7200 # Node ID c2ad1890fc53a951d69747c7d71dc97c6dbf360f # Parent 66d7aabf5b4181ee4f2fc3c60ca4f9a52cd879cb hgk: add debug-config command to pass configuration options diff --git a/contrib/hgk b/contrib/hgk --- a/contrib/hgk +++ b/contrib/hgk @@ -3720,6 +3720,19 @@ proc doquit {} { destroy . } +proc getconfig {} { + global env + + set lines [exec $env(HG) debug-config] + regsub -all "\r\n" $lines "\n" config + set config {} + foreach line [split $lines "\n"] { + regsub "^(k|v)=" $line "" line + lappend config $line + } + return $config +} + # defaults... set datemode 0 set boldnames 0 diff --git a/hgext/hgk.py b/hgext/hgk.py --- a/hgext/hgk.py +++ b/hgext/hgk.py @@ -266,6 +266,14 @@ def revlist(ui, repo, *revs, **opts): copy = [x for x in revs] revtree(copy, repo, full, opts['max_count'], opts['parents']) +def config(ui, repo, **opts): + """print extension options""" + def writeopt(name, value): + ui.write('k=%s\nv=%s\n' % (name, value)) + + writeopt('vdiff', ui.config('hgk', 'vdiff', '')) + + def view(ui, repo, *etc, **opts): "start interactive history viewer" os.chdir(repo.root) @@ -292,6 +300,8 @@ cmdtable = { (catfile, [('s', 'stdin', None, 'stdin')], 'hg debug-cat-file [OPTION]... TYPE FILE'), + "debug-config": + (config, [], 'hg debug-config'), "debug-merge-base": (base, [], 'hg debug-merge-base node node'), "debug-rev-parse":