Patchwork [1,of,2] hgk: remove no longer needed debug-config command

login
register
mail settings
Submitter Andrew Shadura
Date March 29, 2015, 4:01 p.m.
Message ID <2a94f6ac56c89382913a.1427644871@localhost.localdomain>
Download mbox | patch
Permalink /patch/8344/
State Accepted
Headers show

Comments

Andrew Shadura - March 29, 2015, 4:01 p.m.
# HG changeset patch
# User Andrew Shadura <andrew@shadura.me>
# Date 1427574297 -3600
#      Sat Mar 28 21:24:57 2015 +0100
# Node ID 2a94f6ac56c89382913ab813846474c301d2b6fb
# Parent  a922f3f76a20b6952d39275ff2ab18ccbeb837a9
hgk: remove no longer needed debug-config command

Patch

diff --git a/contrib/hgk b/contrib/hgk
--- a/contrib/hgk
+++ b/contrib/hgk
@@ -4051,13 +4051,15 @@  proc doquit {} {
 
 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
+
+    set lines [exec $env(HG) debugconfig]
+    foreach line [split $lines \n] {
+	set line [string trimright $line \r]
+	if {[string match hgk.* $line]} {
+	    regexp {(.*)=(.*)} $line - k v
+	    lappend config $k $v
+	}
     }
     return $config
 }
@@ -4121,8 +4123,9 @@  set redisplaying 0
 set stuffsaved 0
 set patchnum 0
 
+set config(hgk.vdiff) ""
 array set config [getconfig]
-set hgvdiff $config(vdiff)
+set hgvdiff $config(hgk.vdiff)
 setcoords
 makewindow
 readrefs
diff --git a/hgext/hgk.py b/hgext/hgk.py
--- a/hgext/hgk.py
+++ b/hgext/hgk.py
@@ -335,15 +335,6 @@  def revlist(ui, repo, *revs, **opts):
     copy = [x for x in revs]
     revtree(ui, copy, repo, full, opts['max_count'], opts['parents'])
 
-@command('debug-config', [], _('hg debug-config'))
-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', ''))
-
-
 @command('view',
     [('l', 'limit', '',
      _('limit number of changes displayed'), _('NUM'))],