hgk: add debug-config command to pass configuration options
authorPatrick Mezard <pmezard@gmail.com>
Fri, 05 Oct 2007 22:39:36 +0200
changeset 5393 c2ad1890fc53
parent 5392 66d7aabf5b41
child 5394 0ad0e97345eb
hgk: add debug-config command to pass configuration options
contrib/hgk
hgext/hgk.py
--- a/contrib/hgk	Tue Oct 02 23:28:02 2007 +0200
+++ b/contrib/hgk	Fri Oct 05 22:39:36 2007 +0200
@@ -3720,6 +3720,19 @@
     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
--- a/hgext/hgk.py	Tue Oct 02 23:28:02 2007 +0200
+++ b/hgext/hgk.py	Fri Oct 05 22:39:36 2007 +0200
@@ -266,6 +266,14 @@
     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 @@
         (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":