diff mercurial/bundle2.py @ 33040:2baef42a2881

bundle: make applybundle1() return a bundleoperation See previous commit for motivation. It already lets us share a little bit more code in commands.py.
author Martin von Zweigbergk <martinvonz@google.com>
date Wed, 21 Jun 2017 21:08:48 -0700
parents b82615afde65
children 18c2489ac96d
line wrap: on
line diff
--- a/mercurial/bundle2.py	Fri Jun 16 10:25:11 2017 -0700
+++ b/mercurial/bundle2.py	Wed Jun 21 21:08:48 2017 -0700
@@ -311,8 +311,10 @@
     raise TransactionUnavailable()
 
 def applybundle1(repo, cg, tr, source, url, **kwargs):
-    ret, addednodes = cg.apply(repo, tr, source, url, **kwargs)
-    return ret
+    # the transactiongetter won't be used, but we might as well set it
+    op = bundleoperation(repo, lambda: tr)
+    _processchangegroup(op, cg, tr, source, url, **kwargs)
+    return op
 
 def applybundle(repo, unbundler, tr, source=None, url=None):
     # transform me into unbundler.apply() as soon as the freeze is lifted