hgmo: remove dummy changectx class (bug 1360007); r?glob draft
authorGregory Szorc <gps@mozilla.com>
Tue, 23 May 2017 17:15:59 -0700
changeset 11085 f8a2a76ca20b3bd26ec04acb2f67b852b41b0c98
parent 11084 3c465c83e6f38b28ea98812a677903e5000c9ad7
child 11086 14ec72b176be821c84337805a13372d1f1d3434c
push id1683
push userbmo:gps@mozilla.com
push dateWed, 24 May 2017 01:08:55 +0000
reviewersglob
bugs1360007
hgmo: remove dummy changectx class (bug 1360007); r?glob This class was needed so we could pass a changectx like object into pushlog.pushfromchangeset(). Now that the pushlog has an API to accept a node, this fake API class isn't needed. MozReview-Commit-ID: HFcG2SjROc6
hgext/hgmo/__init__.py
--- a/hgext/hgmo/__init__.py
+++ b/hgext/hgmo/__init__.py
@@ -721,27 +721,19 @@ def filelog(orig, web, req, tmpl):
             def __init__(self):
                 self.defaults = tmpl.defaults
 
             def __call__(self, *args, **kwargs):
                 self.args = args
                 self.kwargs = kwargs
                 return self
 
-        class _ctx(object):
-
-            def __init__(self, hex):
-                self._hex = hex
-
-            def hex(self):
-                return self._hex
-
         t = orig(web, req, _tmpl())
         for entry in t.kwargs['entries']:
-            push = web.repo.pushlog.pushfromchangeset(_ctx(entry['node']))
+            push = web.repo.pushlog.pushfromnode(bin(entry['node']))
             if push:
                 entry['pushid'] = push.pushid
                 entry['pushdate'] = util.makedate(push.when)
             else:
                 entry['pushid'] = None
                 entry['pushdate'] = None
 
         return tmpl(*t.args, **t.kwargs)