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

login
register
mail settings
Submitter Pierre-Yves David
Date Oct. 14, 2014, 10:58 p.m.
Message ID <56653edfa2e80c7e5761.1413327482@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/6263/
State Accepted
Headers show

Comments

Pierre-Yves David - Oct. 14, 2014, 10:58 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@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)

Patch

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)