diff mercurial/changegroup.py @ 22968:01e98eba3bc1

addchangegroup: get the `node` argument of `incoming` hook from transaction The transaction is now carrying hook-related informations. So we use it to retrieve the `node` argument. This will also carry around all kinds of other useful informations (like: "are we in a bundle2 processing")
author Pierre-Yves David <pierre-yves.david@fb.com>
date Tue, 14 Oct 2014 00:03:03 -0700
parents 7c13c9404c2c
children 805c18b27f48
line wrap: on
line diff
--- a/mercurial/changegroup.py	Tue Oct 14 23:53:35 2014 -0700
+++ b/mercurial/changegroup.py	Tue Oct 14 00:03:03 2014 -0700
@@ -742,8 +742,9 @@
                           **hookargs)
 
                 for n in added:
-                    repo.hook("incoming", node=hex(n), source=srctype,
-                              url=url)
+                    args = hookargs.copy()
+                    args['node'] = hex(n)
+                    repo.hook("incoming", source=srctype, url=url, **args)
 
                 newheads = [h for h in repo.heads() if h not in oldheads]
                 repo.ui.log("incoming",