Mercurial > public > mercurial-scm > hg
diff hgext/extdiff.py @ 20674:2aafd5854243
extdiff: 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:13:42 -0400 |
parents | 434e5bd615fc |
children | 29eeaa6d662f |
line wrap: on
line diff
--- a/hgext/extdiff.py Wed Mar 12 13:13:10 2014 -0400 +++ b/hgext/extdiff.py Wed Mar 12 13:13:42 2014 -0400 @@ -207,10 +207,10 @@ # Function to quote file/dir names in the argument string. # When not operating in 3-way mode, an empty string is # returned for parent2 - replace = dict(parent=dir1a, parent1=dir1a, parent2=dir1b, - plabel1=label1a, plabel2=label1b, - clabel=label2, child=dir2, - root=repo.root) + replace = {'parent': dir1a, 'parent1': dir1a, 'parent2': dir1b, + 'plabel1': label1a, 'plabel2': label1b, + 'clabel': label2, 'child': dir2, + 'root': repo.root} def quote(match): key = match.group()[1:] if not do3way and key == 'parent2': @@ -316,7 +316,7 @@ that revision is compared to the working directory, and, when no revisions are specified, the working directory files are compared to its parent.\ -''') % dict(path=util.uirepr(path)) +''') % {'path': util.uirepr(path)} # We must translate the docstring right away since it is # used as a format string. The string will unfortunately