applybundle: take source as argument
authorPierre-Yves David <pierre-yves.david@fb.com>
Tue, 20 Oct 2015 15:52:42 +0200
changeset 26793 f37de5d44aea
parent 26792 a84e0cacb2dd
child 26794 238d21f684b5
applybundle: take source as argument We allow specifying the source to carry it to hooks. This gets us closer to 'bundle1.apply(...)' and will allow us to remove regressions in multiple places where we forget to pass the source to hooks.
mercurial/bundle2.py
--- a/mercurial/bundle2.py	Tue Oct 20 15:48:24 2015 +0200
+++ b/mercurial/bundle2.py	Tue Oct 20 15:52:42 2015 +0200
@@ -302,9 +302,11 @@
     to be created"""
     raise TransactionUnavailable()
 
-def applybundle(repo, unbundler, tr, op=None):
+def applybundle(repo, unbundler, tr, source=None, op=None):
     # transform me into unbundler.apply() as soon as the freeze is lifted
     tr.hookargs['bundle2'] = '1'
+    if source is not None and 'source' not in tr.hookargs:
+        tr.hookargs['source'] = source
     return processbundle(repo, unbundler, lambda: tr, op=op)
 
 def processbundle(repo, unbundler, transactiongetter=None, op=None):