pushlog: fix formatting and getting hex value (
bug 1286426); r=glandium
Use sane indentation. Use single quotes for consistency.
Also inline obtaining the hex value using ctx.hex() instead of using
a local variable + hex().
MozReview-Commit-ID: 2uAwdkNpL2U
--- a/hgext/pushlog-legacy/pushlog-feed.py
+++ b/hgext/pushlog-legacy/pushlog-feed.py
@@ -466,25 +466,25 @@ def pushlogHTML(web, req, tmpl):
def pushes_worker(query, repo, full):
"""Given a PushlogQuery, return a data structure mapping push IDs
to a map of data about the push."""
pushes = {}
for id, user, date, node in query.entries:
id = str(id)
if full:
ctx = repo[node]
- n = ctx.node()
- node = {"node": hex(n),
- "author": ctx.user(),
- "desc": ctx.description(),
- "branch": ctx.branch(),
- "parents": [c.hex() for c in ctx.parents()],
- "tags": ctx.tags(),
- "files": ctx.files()
- }
+ node = {
+ 'node': ctx.hex(),
+ 'author': ctx.user(),
+ 'desc': ctx.description(),
+ 'branch': ctx.branch(),
+ 'parents': [c.hex() for c in ctx.parents()],
+ 'tags': ctx.tags(),
+ 'files': ctx.files()
+ }
if id in pushes:
# we get the pushes in reverse order
pushes[id]['changesets'].insert(0, node)
else:
pushes[id] = {'user': user,
'date': date,
'changesets': [node]}