# HG changeset patch # User Christian Ebert # Date 1184489139 -7200 # Node ID 8ddd39a79dc7db419572193ad5284b6e677d12f0 # Parent 4a27c306c6a204ca2463b6c9b82c26955eafca71 Fix ui inheritance for kwdemo kwdemo config changes had no effect if keyword.py was not in hgext. For backwards compatibility we use repo.ui in reposetup, so inside kwdemo the temporary _repo.ui has to obtain the paramters. diff -r 4a27c306c6a2 -r 8ddd39a79dc7 hgkw/keyword.py --- a/hgkw/keyword.py Sun Jul 15 01:19:20 2007 +0200 +++ b/hgkw/keyword.py Sun Jul 15 10:45:39 2007 +0200 @@ -99,21 +99,21 @@ ''' log = 'hg keyword config and expansion example' fn = 'demo.txt' - ui.setconfig('keyword', fn, '') - if opts['default']: - kwstatus = 'default' - kwmaps = deftemplates - if ui.configitems('keywordmaps'): - for k, v in kwmaps.items(): - ui.setconfig('keywordmaps', k, v) - else: - kwstatus = 'current' - kwmaps = dict(ui.configitems('keywordmaps')) or deftemplates tmpdir = tempfile.mkdtemp('', 'kwdemo.') if ui.verbose: ui.status(_('creating temporary repo at %s\n') % tmpdir) _repo = localrepo.localrepository(ui, path=tmpdir, create=True) - reposetup(ui, _repo) + _repo.ui.setconfig('keyword', fn, '') + if opts['default']: + kwstatus = 'default' + kwmaps = deftemplates + else: + kwstatus = 'current' + kwmaps = dict(ui.configitems('keywordmaps')) or deftemplates + if ui.configitems('keywordmaps'): + for k, v in kwmaps.items(): + _repo.ui.setconfig('keywordmaps', k, v) + reposetup(_repo.ui, _repo) ui.status(_('config with %s keyword maps:\n') % kwstatus) ui.write('[keyword]\n%s =\n[keywordmaps\n' % fn) for k, v in kwmaps.items():