comparison 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
comparison
equal deleted inserted replaced
22967:a42d67c16fb9 22968:01e98eba3bc1
740 repo.ui.debug("updating the branch cache\n") 740 repo.ui.debug("updating the branch cache\n")
741 repo.hook("changegroup", source=srctype, url=url, 741 repo.hook("changegroup", source=srctype, url=url,
742 **hookargs) 742 **hookargs)
743 743
744 for n in added: 744 for n in added:
745 repo.hook("incoming", node=hex(n), source=srctype, 745 args = hookargs.copy()
746 url=url) 746 args['node'] = hex(n)
747 repo.hook("incoming", source=srctype, url=url, **args)
747 748
748 newheads = [h for h in repo.heads() if h not in oldheads] 749 newheads = [h for h in repo.heads() if h not in oldheads]
749 repo.ui.log("incoming", 750 repo.ui.log("incoming",
750 "%s incoming changes - new heads: %s\n", 751 "%s incoming changes - new heads: %s\n",
751 len(added), 752 len(added),