comparison hgext/hgk.py @ 5393:c2ad1890fc53

hgk: add debug-config command to pass configuration options
author Patrick Mezard <pmezard@gmail.com>
date Fri, 05 Oct 2007 22:39:36 +0200
parents eadfaa9ec487
children e73a83af7926
comparison
equal deleted inserted replaced
5392:66d7aabf5b41 5393:c2ad1890fc53
264 else: 264 else:
265 full = None 265 full = None
266 copy = [x for x in revs] 266 copy = [x for x in revs]
267 revtree(copy, repo, full, opts['max_count'], opts['parents']) 267 revtree(copy, repo, full, opts['max_count'], opts['parents'])
268 268
269 def config(ui, repo, **opts):
270 """print extension options"""
271 def writeopt(name, value):
272 ui.write('k=%s\nv=%s\n' % (name, value))
273
274 writeopt('vdiff', ui.config('hgk', 'vdiff', ''))
275
276
269 def view(ui, repo, *etc, **opts): 277 def view(ui, repo, *etc, **opts):
270 "start interactive history viewer" 278 "start interactive history viewer"
271 os.chdir(repo.root) 279 os.chdir(repo.root)
272 optstr = ' '.join(['--%s %s' % (k, v) for k, v in opts.iteritems() if v]) 280 optstr = ' '.join(['--%s %s' % (k, v) for k, v in opts.iteritems() if v])
273 cmd = ui.config("hgk", "path", "hgk") + " %s %s" % (optstr, " ".join(etc)) 281 cmd = ui.config("hgk", "path", "hgk") + " %s %s" % (optstr, " ".join(etc))
290 'hg git-diff-tree [OPTION]... NODE1 NODE2 [FILE]...'), 298 'hg git-diff-tree [OPTION]... NODE1 NODE2 [FILE]...'),
291 "debug-cat-file": 299 "debug-cat-file":
292 (catfile, 300 (catfile,
293 [('s', 'stdin', None, 'stdin')], 301 [('s', 'stdin', None, 'stdin')],
294 'hg debug-cat-file [OPTION]... TYPE FILE'), 302 'hg debug-cat-file [OPTION]... TYPE FILE'),
303 "debug-config":
304 (config, [], 'hg debug-config'),
295 "debug-merge-base": 305 "debug-merge-base":
296 (base, [], 'hg debug-merge-base node node'), 306 (base, [], 'hg debug-merge-base node node'),
297 "debug-rev-parse": 307 "debug-rev-parse":
298 (revparse, 308 (revparse,
299 [('', 'default', '', 'ignored')], 309 [('', 'default', '', 'ignored')],