# HG changeset patch # User Augie Fackler # Date 1394645347 14400 # Node ID da6bea33007b0002e8e4a20b259e0964cefbefbb # Parent 0e757575aef5e24f0723ad06cd5742e0c603865f webcommands: move from dict() construction to {} literals The latter are both faster and more consistent across Python 2 and 3. diff -r 0e757575aef5 -r da6bea33007b mercurial/hgweb/webcommands.py --- a/mercurial/hgweb/webcommands.py Wed Mar 12 13:15:37 2014 -0400 +++ b/mercurial/hgweb/webcommands.py Wed Mar 12 13:29:07 2014 -0400 @@ -1018,26 +1018,26 @@ [cgi.escape(x) for x in ctx.tags()], [cgi.escape(x) for x in ctx.bookmarks()])) else: - edgedata = [dict(col=edge[0], nextcol=edge[1], - color=(edge[2] - 1) % 6 + 1, - width=edge[3], bcolor=edge[4]) + edgedata = [{'col': edge[0], 'nextcol': edge[1], + 'color': (edge[2] - 1) % 6 + 1, + 'width': edge[3], 'bcolor': edge[4]} for edge in edges] data.append( - dict(node=node, - col=vtx[0], - color=(vtx[1] - 1) % 6 + 1, - edges=edgedata, - row=row, - nextrow=row + 1, - desc=desc, - user=user, - age=age, - bookmarks=webutil.nodebookmarksdict( - web.repo, ctx.node()), - branches=webutil.nodebranchdict(web.repo, ctx), - inbranch=webutil.nodeinbranch(web.repo, ctx), - tags=webutil.nodetagsdict(web.repo, ctx.node()))) + {'node': node, + 'col': vtx[0], + 'color': (vtx[1] - 1) % 6 + 1, + 'edges': edgedata, + 'row': row, + 'nextrow': row + 1, + 'desc': desc, + 'user': user, + 'age': age, + 'bookmarks': webutil.nodebookmarksdict( + web.repo, ctx.node()), + 'branches': webutil.nodebranchdict(web.repo, ctx), + 'inbranch': webutil.nodeinbranch(web.repo, ctx), + 'tags': webutil.nodetagsdict(web.repo, ctx.node())}) row += 1