[PATCH 3 of 4 STABLE follow-up] streamclone: move requirement update into consumev2

Boris Feld boris.feld at octobus.net
Fri Jan 26 11:07:31 EST 2018


# HG changeset patch
# User Boris Feld <boris.feld at octobus.net>
# Date 1516978267 -3600
#      Fri Jan 26 15:51:07 2018 +0100
# Branch stable
# Node ID 17f4ad0dca3214da14031b33359eec4c1684f75a
# Parent  ba834f589608bfc7ad88a29b22941f322c598760
# EXP-Topic b2-stream
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 17f4ad0dca32
streamclone: move requirement update into consumev2

This change was suggested by Gregory Szorc.

diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py
--- a/mercurial/bundle2.py
+++ b/mercurial/bundle2.py
@@ -2155,11 +2155,3 @@ def handlestreamv2bundle(op, part):
     repo.ui.debug('applying stream bundle\n')
     streamclone.applybundlev2(repo, part, filecount, bytecount,
                               requirements)
-
-    # new requirements = old non-format requirements +
-    #                    new format-related remote requirements
-    # requirements from the streamed-in repository
-    repo.requirements = set(requirements) | (
-            repo.requirements - repo.supportedformats)
-    repo._applyopenerreqs()
-    repo._writerequirements()
diff --git a/mercurial/streamclone.py b/mercurial/streamclone.py
--- a/mercurial/streamclone.py
+++ b/mercurial/streamclone.py
@@ -632,3 +632,11 @@ def applybundlev2(repo, fp, filecount, f
                           ', '.join(sorted(missingreqs)))
 
     consumev2(repo, fp, filecount, filesize)
+
+    # new requirements = old non-format requirements +
+    #                    new format-related remote requirements
+    # requirements from the streamed-in repository
+    repo.requirements = set(requirements) | (
+            repo.requirements - repo.supportedformats)
+    repo._applyopenerreqs()
+    repo._writerequirements()


More information about the Mercurial-devel mailing list