[PATCH 3 of 4] prechangegroup: use hook argument from the transaction

Pierre-Yves David pierre-yves.david at ens-lyon.org
Tue Oct 14 17:58:02 CDT 2014


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at fb.com>
# Date 1413272600 25200
#      Tue Oct 14 00:43:20 2014 -0700
# Node ID 56653edfa2e80c7e57617b9ee16a412e89bcb7c4
# Parent  628b5ad287da3c1ae043a2eb4b1338d7c1a891c7
prechangegroup: use hook argument from the transaction

There can be useful data in there (eg: bundle2 related one)

diff --git a/mercurial/changegroup.py b/mercurial/changegroup.py
--- a/mercurial/changegroup.py
+++ b/mercurial/changegroup.py
@@ -601,11 +601,12 @@ def addchangegroup(repo, source, srctype
     cl.delayupdate()
     oldheads = cl.heads()
 
     tr = repo.transaction("\n".join([srctype, util.hidepassword(url)]))
     try:
-        repo.hook('prechangegroup', throw=True, source=srctype, url=url)
+        repo.hook('prechangegroup', throw=True, source=srctype, url=url,
+                  **tr.hookargs)
 
         trp = weakref.proxy(tr)
         # pull off the changeset group
         repo.ui.status(_("adding changesets\n"))
         clstart = len(cl)


More information about the Mercurial-devel mailing list