# HG changeset patch # User Augie Fackler # Date 1394644509 14400 # Node ID 89b2336e5ccfdbdc2282b9bfd54127f54074ae3e # Parent f8d50add83e18d2f078cb34672cb8198eef91e92 filemerge: move from dict() construction to {} literals The latter are both faster and more consistent across Python 2 and 3. diff -r f8d50add83e1 -r 89b2336e5ccf mercurial/filemerge.py --- 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,