D4978: wireprotov2: stop sending phase updates for base revisions

indygreg (Gregory Szorc) phabricator at mercurial-scm.org
Fri Oct 12 11:16:54 EDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rHG6c42409691ec: wireprotov2: stop sending phase updates for base revisions (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D4978?vs=11844&id=11885

REVISION DETAIL
  https://phab.mercurial-scm.org/D4978

AFFECTED FILES
  mercurial/wireprotov2server.py
  tests/test-wireproto-command-changesetdata.t
  tests/test-wireproto-exchangev2.t

CHANGE DETAILS

diff --git a/tests/test-wireproto-exchangev2.t b/tests/test-wireproto-exchangev2.t
--- a/tests/test-wireproto-exchangev2.t
+++ b/tests/test-wireproto-exchangev2.t
@@ -324,7 +324,7 @@
   }
   received frame(size=9; request=1; stream=2; streamflags=stream-begin; type=stream-settings; flags=eos)
   received frame(size=11; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
-  received frame(size=613; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
+  received frame(size=573; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
   received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
   add changeset cd2534766bec
   add changeset e96ae20f4188
@@ -407,6 +407,7 @@
        4       4 379cb0c2e664 045c7f3927da 000000000000
 
 Phase-only update works
+TODO this doesn't work
 
   $ hg -R ../server-simple phase --public -r caa2a465451dd
   $ hg --debug pull
@@ -452,17 +453,16 @@
   }
   received frame(size=9; request=1; stream=2; streamflags=stream-begin; type=stream-settings; flags=eos)
   received frame(size=11; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
-  received frame(size=92; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
+  received frame(size=13; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
   received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
   checking for updated bookmarks
-  2 local changesets published
   (run 'hg update' to get a working copy)
   (sent 3 HTTP requests and * bytes; received * bytes in responses) (glob)
 
   $ hg log -G -T '{rev} {node} {phase}\n'
-  o  4 caa2a465451dd1facda0f5b12312c355584188a1 public
+  o  4 caa2a465451dd1facda0f5b12312c355584188a1 draft
   |
-  o  3 e96ae20f4188487b9ae4ef3941c27c81143146e5 public
+  o  3 e96ae20f4188487b9ae4ef3941c27c81143146e5 draft
   |
   | o  2 cd2534766bece138c7c1afdc6825302f0f62d81f draft
   | |
@@ -632,7 +632,7 @@
   }
   received frame(size=9; request=1; stream=2; streamflags=stream-begin; type=stream-settings; flags=eos)
   received frame(size=11; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
-  received frame(size=144; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
+  received frame(size=65; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
   received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
   checking for updated bookmarks
   updating bookmark book-1
diff --git a/tests/test-wireproto-command-changesetdata.t b/tests/test-wireproto-command-changesetdata.t
--- a/tests/test-wireproto-command-changesetdata.t
+++ b/tests/test-wireproto-command-changesetdata.t
@@ -426,6 +426,7 @@
   ]
 
 Base nodes have just their metadata (e.g. phase) transferred
+TODO this doesn't work
 
   $ sendhttpv2peer << EOF
   > command changesetdata
@@ -439,10 +440,6 @@
       b'totalitems': 3
     },
     {
-      b'node': b'3\x90\xef\x85\x00s\xfb\xc2\xf0\xdf\xff"D4,\x8e\x92)\x01:',
-      b'phase': b'public'
-    },
-    {
       b'fieldsfollowing': [
         [
           b'revision',
diff --git a/mercurial/wireprotov2server.py b/mercurial/wireprotov2server.py
--- a/mercurial/wireprotov2server.py
+++ b/mercurial/wireprotov2server.py
@@ -875,15 +875,11 @@
     # The phases of nodes already transferred to the client may have changed
     # since the client last requested data. We send phase-only records
     # for these revisions, if requested.
-    if b'phase' in fields and noderange is not None:
-        # TODO skip nodes whose phase will be reflected by a node in the
-        # outgoing set. This is purely an optimization to reduce data
-        # size.
-        for node in noderange[0]:
-            yield {
-                b'node': node,
-                b'phase': b'public' if publishing else repo[node].phasestr()
-            }
+    # TODO actually do this. We'll probably want to emit phase heads
+    # in the ancestry set of the outgoing revisions. This will ensure
+    # that phase updates within that set are seen.
+    if b'phase' in fields:
+        pass
 
     nodebookmarks = {}
     for mark, node in repo._bookmarks.items():



To: indygreg, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list