Patchwork [10,of,10] bundle: inline applybundle1()

login
register
mail settings
Submitter via Mercurial-devel
Date June 24, 2017, 3:38 p.m.
Message ID <f0b522fb7bdbfa26c750.1498318718@martinvonz.svl.corp.google.com>
Download mbox | patch
Permalink /patch/21674/
State Accepted
Headers show

Comments

via Mercurial-devel - June 24, 2017, 3:38 p.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1498193132 25200
#      Thu Jun 22 21:45:32 2017 -0700
# Node ID f0b522fb7bdbfa26c7504afb6c2516ddad065878
# Parent  a5adc63a7b001cc4c489e7ea4d574e71adccafe7
bundle: inline applybundle1()

We have now gotten rid of all but one caller, so let's inline it
there.
Augie Fackler - June 24, 2017, 7:42 p.m.
On Sat, Jun 24, 2017 at 08:38:38AM -0700, Martin von Zweigbergk via Mercurial-devel wrote:
> # HG changeset patch
> # User Martin von Zweigbergk <martinvonz@google.com>
> # Date 1498193132 25200
> #      Thu Jun 22 21:45:32 2017 -0700
> # Node ID f0b522fb7bdbfa26c7504afb6c2516ddad065878
> # Parent  a5adc63a7b001cc4c489e7ea4d574e71adccafe7
> bundle: inline applybundle1()

queued, thanks

Patch

diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py
--- a/mercurial/bundle2.py
+++ b/mercurial/bundle2.py
@@ -310,12 +310,6 @@ 
     to be created"""
     raise TransactionUnavailable()
 
-def applybundle1(repo, cg, tr, source, url, **kwargs):
-    # 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, **kwargs):
     # transform me into unbundler.apply() as soon as the freeze is lifted
     if isinstance(unbundler, unbundle20):
@@ -326,7 +320,10 @@ 
             tr.hookargs['url'] = url
         return processbundle(repo, unbundler, lambda: tr)
     else:
-        return applybundle1(repo, unbundler, tr, source, url, **kwargs)
+        # the transactiongetter won't be used, but we might as well set it
+        op = bundleoperation(repo, lambda: tr)
+        _processchangegroup(op, unbundler, tr, source, url, **kwargs)
+        return op
 
 def processbundle(repo, unbundler, transactiongetter=None, op=None):
     """This function process a bundle, apply effect to/from a repo