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

login
register
mail settings
Submitter Boris Feld
Date Jan. 26, 2018, 4:07 p.m.
Message ID <17f4ad0dca3214da1403.1516982851@FB>
Download mbox | patch
Permalink /patch/27067/
State Accepted
Headers show

Comments

Boris Feld - Jan. 26, 2018, 4:07 p.m.
# HG changeset patch
# User Boris Feld <boris.feld@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.

Patch

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()