# HG changeset patch # User Pierre-Yves David # Date 2015-10-20 13:52:42 # Node ID f37de5d44aea401af0b60c3e4bf798cc1c9235c2 # Parent a84e0cacb2dd0527eecd99c07d25e672c18eca2c 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. diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py --- a/mercurial/bundle2.py +++ b/mercurial/bundle2.py @@ -302,9 +302,11 @@ def _notransaction(): 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):