addchangegroup: register data in tr.hookargs
authorPierre-Yves David <pierre-yves.david@fb.com>
Thu, 17 Apr 2014 17:09:20 -0400
changeset 21151 240d340fe152
parent 21150 0d05915b688d
child 21152 30bce7e60140
addchangegroup: register data in tr.hookargs We are registering data related to the process into the transaction hook data. This lets other parties using the same transaction get informed of the addchangegroup result.
mercurial/changegroup.py
--- a/mercurial/changegroup.py	Thu Apr 17 17:04:59 2014 -0400
+++ b/mercurial/changegroup.py	Thu Apr 17 17:09:20 2014 -0400
@@ -673,6 +673,8 @@
 
         if changesets > 0:
             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)