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.
[ original upstream message ]
--- a/hgkw/keyword.py Wed Mar 12 13:19:43 2014 -0400
+++ b/hgkw/keyword.py Wed Mar 19 02:45:14 2014 +0100
@@ -384,10 +384,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'):
@@ -418,7 +418,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:
@@ -444,7 +444,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)