Mercurial > public > mercurial-scm > hg-stable
diff hgext/histedit.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 | efbf15979538 |
children | d66862b87ae6 |
line wrap: on
line diff
--- a/hgext/histedit.py Wed Mar 19 02:45:14 2014 +0100 +++ b/hgext/histedit.py Wed Mar 19 02:45:14 2014 +0100 @@ -198,7 +198,8 @@ def commitfunc(**kwargs): phasebackup = repo.ui.backupconfig('phases', 'new-commit') try: - repo.ui.setconfig('phases', 'new-commit', phasemin) + repo.ui.setconfig('phases', 'new-commit', phasemin, + 'histedit') extra = kwargs.get('extra', {}).copy() extra['histedit_source'] = src.hex() kwargs['extra'] = extra @@ -220,11 +221,12 @@ else: try: # ui.forcemerge is an internal variable, do not document - repo.ui.setconfig('ui', 'forcemerge', opts.get('tool', '')) + repo.ui.setconfig('ui', 'forcemerge', opts.get('tool', ''), + 'histedit') stats = mergemod.update(repo, ctx.node(), True, True, False, ctx.p1().node()) finally: - repo.ui.setconfig('ui', 'forcemerge', '') + repo.ui.setconfig('ui', 'forcemerge', '', 'histedit') repo.setparents(wcpar, node.nullid) repo.dirstate.write() # fix up dirstate for copies and renames @@ -375,7 +377,7 @@ phasebackup = repo.ui.backupconfig('phases', 'new-commit') try: phasemin = max(ctx.phase(), oldctx.phase()) - repo.ui.setconfig('phases', 'new-commit', phasemin) + repo.ui.setconfig('phases', 'new-commit', phasemin, 'histedit') n = collapse(repo, ctx, repo[newnode], commitopts) finally: repo.ui.restoreconfig(phasebackup)