pushlog: fix formatting and getting hex value (bug 1286426); r=glandium
authorGregory Szorc <gps@mozilla.com>
Thu, 14 Jul 2016 12:06:29 -0700
changeset 8964 86f3b4051c1893fdca26efe77269ddcb3451e1d6
parent 8963 8db703bd97e8bb41f9bf053c750b4e0c605151b3
child 8965 4bbdf0516df1d6258fbf1072052ba81c0b08ac09
push id1034
push userbmo:gps@mozilla.com
push dateTue, 19 Jul 2016 18:10:24 +0000
reviewersglandium
bugs1286426
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
hgext/pushlog-legacy/pushlog-feed.py
--- 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]}