# HG changeset patch # User Pierre-Yves David # Date 2015-10-20 13:45:39 # Node ID 28a6c2d72097d6478434c01347d3330b153f0e45 # Parent e6003ecf325782c7124d6b87162543d4553c0320 bundle2: introduce an "applybundle" function There is a case where the intent is clear and the transaction is not optional. We want to be able to alter that transaction in a wide and easy way. We cannot get a unified '.apply(repo)' method for bundle1 and bundle2 yet because the api are still a bit too far apart. But this is a good step forward to get the rc out. diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py --- a/mercurial/bundle2.py +++ b/mercurial/bundle2.py @@ -302,6 +302,10 @@ def _notransaction(): to be created""" raise TransactionUnavailable() +def applybundle(repo, unbundler, tr, op=None): + # transform me into unbundler.apply() as soon as the freeze is lifted + 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