changeset 34261:f010097c885c

bundle2: move part processing to a separate function Now that the part processing loop is tiny, let's move it to a separate function. This will allow extensions to completely replace the part processing logic, without having to replace the overall bundle processing logic or the stream maintenance logic. This will be useful for the infinitepush extension, so it can completely take over receiving a bundle and rerouting it to a side store. This will also make it easier to upstream the infinitepush functionality later. Differential Revision: https://phab.mercurial-scm.org/D709
author Durham Goode <durham@fb.com>
date Thu, 14 Sep 2017 10:20:05 -0700
parents cc7b37c90616
children 68c96a552c84
files mercurial/bundle2.py
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/bundle2.py	Thu Sep 14 10:20:05 2017 -0700
+++ b/mercurial/bundle2.py	Thu Sep 14 10:20:05 2017 -0700
@@ -447,12 +447,15 @@
         msg.append('\n')
         repo.ui.debug(''.join(msg))
 
+    processparts(repo, op, unbundler)
+
+    return op
+
+def processparts(repo, op, unbundler):
     with partiterator(repo, op, unbundler) as parts:
         for part in parts:
             _processpart(op, part)
 
-    return op
-
 def _processchangegroup(op, cg, tr, source, url, **kwargs):
     ret = cg.apply(op.repo, tr, source, url, **kwargs)
     op.records.add('changegroup', {