[PATCH 06 of 14 FIX-bundle2] applybundle: take url as argument

Pierre-Yves David pierre-yves.david at ens-lyon.org
Tue Oct 20 09:36:22 CDT 2015


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at fb.com>
# Date 1445349304 -7200
#      Tue Oct 20 15:55:04 2015 +0200
# Node ID 6a047ac5272421588ec1ac05bb27a37b97d02998
# Parent  629c8862faa83a0cb61a0279ae0af484f895e824
# EXP-Topic generaldelta
# Available At http://hg.netv6.net/marmoute-wip/mercurial/
#              hg pull http://hg.netv6.net/marmoute-wip/mercurial/ -r 6a047ac52724
applybundle: take url as argument

We allow to specify the url to carry it to hooks. This get use closer to
'bundle1.apply(...)' and will also use to remove regression in multiple place
were we forget to pass the url to hooks.

diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py
--- a/mercurial/bundle2.py
+++ b/mercurial/bundle2.py
@@ -300,15 +300,17 @@ def _notransaction():
 
     Raise an exception to highlight the fact that no transaction was expected
     to be created"""
     raise TransactionUnavailable()
 
-def applybundle(repo, unbundler, tr, source=None, op=None):
+def applybundle(repo, unbundler, tr, source=None, url=None, op=None):
     # transform me in 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
+    if url is not None and 'source' not in tr.hookargs:
+        tr.hookargs['url'] = source
     return processbundle(repo, unbundler, lambda: tr, op=op)
 
 def processbundle(repo, unbundler, transactiongetter=None, op=None):
     """This function process a bundle, apply effect to/from a repo
 


More information about the Mercurial-devel mailing list