changegroup: use tr.hookargs when calling pretxnchangegroup hooks
authorPierre-Yves David <pierre-yves.david@fb.com>
Thu, 17 Apr 2014 17:15:02 -0400
changeset 21152 30bce7e60140
parent 21151 240d340fe152
child 21153 53ee02b54e53
changegroup: use tr.hookargs when calling pretxnchangegroup hooks So that other parties using the transaction can put information in our hook calls.
mercurial/changegroup.py
--- a/mercurial/changegroup.py	Thu Apr 17 17:09:20 2014 -0400
+++ b/mercurial/changegroup.py	Thu Apr 17 17:15:02 2014 -0400
@@ -675,9 +675,8 @@
             p = lambda: cl.writepending() and repo.root or ""
             if 'node' not in tr.hookargs:
                 tr.hookargs['node'] = hex(cl.node(clstart))
-            repo.hook('pretxnchangegroup', throw=True,
-                      node=hex(cl.node(clstart)), source=srctype,
-                      url=url, pending=p)
+            repo.hook('pretxnchangegroup', throw=True, source=srctype,
+                      url=url, pending=p, **tr.hookargs)
 
         added = [cl.node(r) for r in xrange(clstart, clend)]
         publishing = repo.ui.configbool('phases', 'publish', True)