filemerge: move from dict() construction to {} literals
The latter are both faster and more consistent across Python 2 and 3.
--- a/mercurial/filemerge.py Wed Mar 12 13:14:31 2014 -0400
+++ b/mercurial/filemerge.py Wed Mar 12 13:15:09 2014 -0400
@@ -248,20 +248,21 @@
tool, toolpath, binary, symlink = toolconf
a, b, c, back = files
out = ""
- env = dict(HG_FILE=fcd.path(),
- HG_MY_NODE=short(mynode),
- HG_OTHER_NODE=str(fco.changectx()),
- HG_BASE_NODE=str(fca.changectx()),
- HG_MY_ISLINK='l' in fcd.flags(),
- HG_OTHER_ISLINK='l' in fco.flags(),
- HG_BASE_ISLINK='l' in fca.flags())
+ env = {'HG_FILE': fcd.path(),
+ 'HG_MY_NODE': short(mynode),
+ 'HG_OTHER_NODE': str(fco.changectx()),
+ 'HG_BASE_NODE': str(fca.changectx()),
+ 'HG_MY_ISLINK': 'l' in fcd.flags(),
+ 'HG_OTHER_ISLINK': 'l' in fco.flags(),
+ 'HG_BASE_ISLINK': 'l' in fca.flags(),
+ }
ui = repo.ui
args = _toolstr(ui, tool, "args", '$local $base $other')
if "$output" in args:
out, a = a, back # read input from backup, write to original
- replace = dict(local=a, base=b, other=c, output=out)
+ replace = {'local': a, 'base': b, 'other': c, 'output': out}
args = util.interpolate(r'\$', replace, args,
lambda s: util.shellquote(util.localpath(s)))
r = util.system(toolpath + ' ' + args, cwd=repo.root, environ=env,