changeset 20676:89b2336e5ccf

filemerge: move from dict() construction to {} literals The latter are both faster and more consistent across Python 2 and 3.
author Augie Fackler <raf@durin42.com>
date Wed, 12 Mar 2014 13:15:09 -0400
parents f8d50add83e1
children 0e757575aef5
files mercurial/filemerge.py
diffstat 1 files changed, 9 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- 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,