Mercurial > public > mercurial-scm > hg-stable
diff hgext/keyword.py @ 20790:49f2d5644f04
config: set a 'source' in most cases where config don't come from file but code
Some extensions set configuration settings that showed up in 'hg showconfig
--debug' with 'none' as source. That was confusing.
Instead, they will now tell which extension they come from.
This change tries to be consistent and specify a source everywhere - also where
it perhaps is less relevant.
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Wed, 19 Mar 2014 02:45:14 +0100 |
parents | 3a35ba2681ec |
children | 99f7e5fe35f2 |
line wrap: on
line diff
--- a/hgext/keyword.py Wed Mar 19 02:45:14 2014 +0100 +++ b/hgext/keyword.py Wed Mar 19 02:45:14 2014 +0100 @@ -385,10 +385,10 @@ tmpdir = tempfile.mkdtemp('', 'kwdemo.') ui.note(_('creating temporary repository at %s\n') % tmpdir) repo = localrepo.localrepository(repo.baseui, tmpdir, True) - ui.setconfig('keyword', fn, '') + ui.setconfig('keyword', fn, '', 'keyword') svn = ui.configbool('keywordset', 'svn') # explicitly set keywordset for demo output - ui.setconfig('keywordset', 'svn', svn) + ui.setconfig('keywordset', 'svn', svn, 'keyword') uikwmaps = ui.configitems('keywordmaps') if args or opts.get('rcfile'): @@ -419,7 +419,7 @@ if uikwmaps: ui.status(_('\tdisabling current template maps\n')) for k, v in kwmaps.iteritems(): - ui.setconfig('keywordmaps', k, v) + ui.setconfig('keywordmaps', k, v, 'keyword') else: ui.status(_('\n\tconfiguration using current keyword template maps\n')) if uikwmaps: @@ -445,7 +445,7 @@ wlock.release() for name, cmd in ui.configitems('hooks'): if name.split('.', 1)[0].find('commit') > -1: - repo.ui.setconfig('hooks', name, '') + repo.ui.setconfig('hooks', name, '', 'keyword') msg = _('hg keyword configuration and expansion example') ui.note(("hg ci -m '%s'\n" % msg)) repo.commit(text=msg)