diff mercurial/bundle2.py @ 33039:b82615afde65

bundle: add a applybundle1() method This is one step towards removing a bunch of "if isinstance(gen, unbundle20)" by treating bundle1 and bundle2 more similarly. The name may sounds ironic for a method in the bundle2 module, but I didn't think it was worth it yet to create a new 'bundle' module that depends on the 'bundle2' module. Besides, we'll inline the method again later.
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 16 Jun 2017 10:25:11 -0700
parents f0efd2bffe1e
children 2baef42a2881
line wrap: on
line diff
--- a/mercurial/bundle2.py	Thu Jun 22 15:59:07 2017 -0700
+++ b/mercurial/bundle2.py	Fri Jun 16 10:25:11 2017 -0700
@@ -310,6 +310,10 @@
     to be created"""
     raise TransactionUnavailable()
 
+def applybundle1(repo, cg, tr, source, url, **kwargs):
+    ret, addednodes = cg.apply(repo, tr, source, url, **kwargs)
+    return ret
+
 def applybundle(repo, unbundler, tr, source=None, url=None):
     # transform me into unbundler.apply() as soon as the freeze is lifted
     tr.hookargs['bundle2'] = '1'