D4486: exchangev2: fetch and apply bookmarks

2018-09-14 Thread indygreg (Gregory Szorc)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG349482d726ee: exchangev2: fetch and apply bookmarks 
(authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D4486?vs=10966=11064

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

AFFECTED FILES
  mercurial/exchangev2.py
  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
@@ -54,6 +54,7 @@
   sending 1 commands
   sending command changesetdata: {
 'fields': set([
+  'bookmarks',
   'parents',
   'phase',
   'revision'
@@ -74,6 +75,7 @@
   add changeset cd2534766bec
   add changeset e96ae20f4188
   add changeset caa2a465451d
+  checking for updated bookmarks
   updating the branch cache
   new changesets 3390ef850073:caa2a465451d (3 drafts)
 
@@ -126,6 +128,7 @@
   sending 1 commands
   sending command changesetdata: {
 'fields': set([
+  'bookmarks',
   'parents',
   'phase',
   'revision'
@@ -142,6 +145,7 @@
   received frame(size=0; request=1; stream=2; streamflags=; 
type=command-response; flags=eos)
   add changeset 3390ef850073
   add changeset 4432d83626e8
+  checking for updated bookmarks
   updating the branch cache
   new changesets 3390ef850073:4432d83626e8
 
@@ -178,6 +182,7 @@
   sending 1 commands
   sending command changesetdata: {
 'fields': set([
+  'bookmarks',
   'parents',
   'phase',
   'revision'
@@ -198,6 +203,7 @@
   add changeset cd2534766bec
   add changeset e96ae20f4188
   add changeset caa2a465451d
+  checking for updated bookmarks
   updating the branch cache
   new changesets cd2534766bec:caa2a465451d (3 drafts)
   (run 'hg update' to get a working copy)
@@ -241,6 +247,7 @@
   sending 1 commands
   sending command changesetdata: {
 'fields': set([
+  'bookmarks',
   'parents',
   'phase',
   'revision'
@@ -259,6 +266,7 @@
   received frame(size=11; request=1; stream=2; streamflags=stream-begin; 
type=command-response; flags=continuation)
   received frame(size=92; request=1; stream=2; streamflags=; 
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)
 
@@ -275,3 +283,113 @@
   
 
   $ cd ..
+
+Bookmarks are transferred on clone
+
+  $ hg -R server-simple bookmark -r 3390ef850073fbc2f0dfff2244342c8e9229013a 
book-1
+  $ hg -R server-simple bookmark -r cd2534766bece138c7c1afdc6825302f0f62d81f 
book-2
+
+  $ hg --debug clone -U http://localhost:$HGPORT/ client-bookmarks
+  using http://localhost:$HGPORT/
+  sending capabilities command
+  query 1; heads
+  sending 2 commands
+  sending command heads: {}
+  sending command known: {
+'nodes': []
+  }
+  received frame(size=11; request=1; stream=2; streamflags=stream-begin; 
type=command-response; flags=continuation)
+  received frame(size=43; request=1; stream=2; streamflags=; 
type=command-response; flags=continuation)
+  received frame(size=0; request=1; stream=2; streamflags=; 
type=command-response; flags=eos)
+  received frame(size=11; request=3; stream=2; streamflags=; 
type=command-response; flags=continuation)
+  received frame(size=1; request=3; stream=2; streamflags=; 
type=command-response; flags=continuation)
+  received frame(size=0; request=3; stream=2; streamflags=; 
type=command-response; flags=eos)
+  sending 1 commands
+  sending command changesetdata: {
+'fields': set([
+  'bookmarks',
+  'parents',
+  'phase',
+  'revision'
+]),
+'noderange': [
+  [],
+  [
+'\xca\xa2\xa4eE\x1d\xd1\xfa\xcd\xa0\xf5\xb1#\x12\xc3UXA\x88\xa1',
+'\xcd%4vk\xec\xe18\xc7\xc1\xaf\xdch%0/\x0fb\xd8\x1f'
+  ]
+]
+  }
+  received frame(size=11; request=1; stream=2; streamflags=stream-begin; 
type=command-response; flags=continuation)
+  received frame(size=909; request=1; stream=2; streamflags=; 
type=command-response; flags=continuation)
+  received frame(size=0; request=1; stream=2; streamflags=; 
type=command-response; flags=eos)
+  add changeset 3390ef850073
+  add changeset 4432d83626e8
+  add changeset cd2534766bec
+  add changeset e96ae20f4188
+  add changeset caa2a465451d
+  checking for updated bookmarks
+  adding remote bookmark book-1
+  adding remote bookmark book-2
+  updating the branch cache
+  new changesets 3390ef850073:caa2a465451d (1 drafts)
+
+  $ hg -R client-bookmarks bookmarks
+ book-10:3390ef850073
+ book-22:cd2534766bec
+
+Server-side bookmark moves are reflected during `hg pull`
+
+  $ hg -R server-simple bookmark -r cd2534766bece138c7c1afdc6825302f0f62d81f 
book-1
+  moving bookmark 'book-1' forward from 

D4486: exchangev2: fetch and apply bookmarks

2018-09-12 Thread indygreg (Gregory Szorc)
indygreg updated this revision to Diff 10966.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D4486?vs=10799=10966

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

AFFECTED FILES
  mercurial/exchangev2.py
  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
@@ -54,6 +54,7 @@
   sending 1 commands
   sending command changesetdata: {
 'fields': set([
+  'bookmarks',
   'parents',
   'phase',
   'revision'
@@ -74,6 +75,7 @@
   add changeset cd2534766bec
   add changeset e96ae20f4188
   add changeset caa2a465451d
+  checking for updated bookmarks
   updating the branch cache
   new changesets 3390ef850073:caa2a465451d (3 drafts)
 
@@ -126,6 +128,7 @@
   sending 1 commands
   sending command changesetdata: {
 'fields': set([
+  'bookmarks',
   'parents',
   'phase',
   'revision'
@@ -142,6 +145,7 @@
   received frame(size=0; request=1; stream=2; streamflags=; 
type=command-response; flags=eos)
   add changeset 3390ef850073
   add changeset 4432d83626e8
+  checking for updated bookmarks
   updating the branch cache
   new changesets 3390ef850073:4432d83626e8
 
@@ -178,6 +182,7 @@
   sending 1 commands
   sending command changesetdata: {
 'fields': set([
+  'bookmarks',
   'parents',
   'phase',
   'revision'
@@ -198,6 +203,7 @@
   add changeset cd2534766bec
   add changeset e96ae20f4188
   add changeset caa2a465451d
+  checking for updated bookmarks
   updating the branch cache
   new changesets cd2534766bec:caa2a465451d (3 drafts)
   (run 'hg update' to get a working copy)
@@ -241,6 +247,7 @@
   sending 1 commands
   sending command changesetdata: {
 'fields': set([
+  'bookmarks',
   'parents',
   'phase',
   'revision'
@@ -259,6 +266,7 @@
   received frame(size=11; request=1; stream=2; streamflags=stream-begin; 
type=command-response; flags=continuation)
   received frame(size=92; request=1; stream=2; streamflags=; 
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)
 
@@ -275,3 +283,113 @@
   
 
   $ cd ..
+
+Bookmarks are transferred on clone
+
+  $ hg -R server-simple bookmark -r 3390ef850073fbc2f0dfff2244342c8e9229013a 
book-1
+  $ hg -R server-simple bookmark -r cd2534766bece138c7c1afdc6825302f0f62d81f 
book-2
+
+  $ hg --debug clone -U http://localhost:$HGPORT/ client-bookmarks
+  using http://localhost:$HGPORT/
+  sending capabilities command
+  query 1; heads
+  sending 2 commands
+  sending command heads: {}
+  sending command known: {
+'nodes': []
+  }
+  received frame(size=11; request=1; stream=2; streamflags=stream-begin; 
type=command-response; flags=continuation)
+  received frame(size=43; request=1; stream=2; streamflags=; 
type=command-response; flags=continuation)
+  received frame(size=0; request=1; stream=2; streamflags=; 
type=command-response; flags=eos)
+  received frame(size=11; request=3; stream=2; streamflags=; 
type=command-response; flags=continuation)
+  received frame(size=1; request=3; stream=2; streamflags=; 
type=command-response; flags=continuation)
+  received frame(size=0; request=3; stream=2; streamflags=; 
type=command-response; flags=eos)
+  sending 1 commands
+  sending command changesetdata: {
+'fields': set([
+  'bookmarks',
+  'parents',
+  'phase',
+  'revision'
+]),
+'noderange': [
+  [],
+  [
+'\xca\xa2\xa4eE\x1d\xd1\xfa\xcd\xa0\xf5\xb1#\x12\xc3UXA\x88\xa1',
+'\xcd%4vk\xec\xe18\xc7\xc1\xaf\xdch%0/\x0fb\xd8\x1f'
+  ]
+]
+  }
+  received frame(size=11; request=1; stream=2; streamflags=stream-begin; 
type=command-response; flags=continuation)
+  received frame(size=909; request=1; stream=2; streamflags=; 
type=command-response; flags=continuation)
+  received frame(size=0; request=1; stream=2; streamflags=; 
type=command-response; flags=eos)
+  add changeset 3390ef850073
+  add changeset 4432d83626e8
+  add changeset cd2534766bec
+  add changeset e96ae20f4188
+  add changeset caa2a465451d
+  checking for updated bookmarks
+  adding remote bookmark book-1
+  adding remote bookmark book-2
+  updating the branch cache
+  new changesets 3390ef850073:caa2a465451d (1 drafts)
+
+  $ hg -R client-bookmarks bookmarks
+ book-10:3390ef850073
+ book-22:cd2534766bec
+
+Server-side bookmark moves are reflected during `hg pull`
+
+  $ hg -R server-simple bookmark -r cd2534766bece138c7c1afdc6825302f0f62d81f 
book-1
+  moving bookmark 'book-1' forward from 3390ef850073
+
+  $ hg -R client-bookmarks --debug pull
+  pulling from http://localhost:$HGPORT/
+  using http://localhost:$HGPORT/
+  

D4486: exchangev2: fetch and apply bookmarks

2018-09-05 Thread indygreg (Gregory Szorc)
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This is pretty similar to phases data. We collect bookmarks data
  as we process records. Then at the end we make a call to the
  bookmarks subsystem to reflect the remote's bookmarks.
  
  Like phases, the code for handling bookmarks is vastly simpler
  than the previous wire protocol code because the server always
  transfers the full set of bookmarks when bookmarks are requested.
  We don't have to keep track of whether we requested bookmarks or
  not.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/exchangev2.py
  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
@@ -54,6 +54,7 @@
   sending 1 commands
   sending command changesetdata: {
 'fields': set([
+  'bookmarks',
   'parents',
   'phase',
   'revision'
@@ -74,6 +75,7 @@
   add changeset cd2534766bec
   add changeset e96ae20f4188
   add changeset caa2a465451d
+  checking for updated bookmarks
   updating the branch cache
   new changesets 3390ef850073:caa2a465451d
 
@@ -126,6 +128,7 @@
   sending 1 commands
   sending command changesetdata: {
 'fields': set([
+  'bookmarks',
   'parents',
   'phase',
   'revision'
@@ -142,6 +145,7 @@
   received frame(size=0; request=1; stream=2; streamflags=; 
type=command-response; flags=eos)
   add changeset 3390ef850073
   add changeset 4432d83626e8
+  checking for updated bookmarks
   updating the branch cache
   new changesets 3390ef850073:4432d83626e8
 
@@ -178,6 +182,7 @@
   sending 1 commands
   sending command changesetdata: {
 'fields': set([
+  'bookmarks',
   'parents',
   'phase',
   'revision'
@@ -198,6 +203,7 @@
   add changeset cd2534766bec
   add changeset e96ae20f4188
   add changeset caa2a465451d
+  checking for updated bookmarks
   updating the branch cache
   new changesets cd2534766bec:caa2a465451d
   (run 'hg update' to get a working copy)
@@ -241,6 +247,7 @@
   sending 1 commands
   sending command changesetdata: {
 'fields': set([
+  'bookmarks',
   'parents',
   'phase',
   'revision'
@@ -259,6 +266,7 @@
   received frame(size=11; request=1; stream=2; streamflags=stream-begin; 
type=command-response; flags=continuation)
   received frame(size=92; request=1; stream=2; streamflags=; 
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)
 
@@ -275,3 +283,113 @@
   
 
   $ cd ..
+
+Bookmarks are transferred on clone
+
+  $ hg -R server-simple bookmark -r 3390ef850073fbc2f0dfff2244342c8e9229013a 
book-1
+  $ hg -R server-simple bookmark -r cd2534766bece138c7c1afdc6825302f0f62d81f 
book-2
+
+  $ hg --debug clone -U http://localhost:$HGPORT/ client-bookmarks
+  using http://localhost:$HGPORT/
+  sending capabilities command
+  query 1; heads
+  sending 2 commands
+  sending command heads: {}
+  sending command known: {
+'nodes': []
+  }
+  received frame(size=11; request=1; stream=2; streamflags=stream-begin; 
type=command-response; flags=continuation)
+  received frame(size=43; request=1; stream=2; streamflags=; 
type=command-response; flags=continuation)
+  received frame(size=0; request=1; stream=2; streamflags=; 
type=command-response; flags=eos)
+  received frame(size=11; request=3; stream=2; streamflags=; 
type=command-response; flags=continuation)
+  received frame(size=1; request=3; stream=2; streamflags=; 
type=command-response; flags=continuation)
+  received frame(size=0; request=3; stream=2; streamflags=; 
type=command-response; flags=eos)
+  sending 1 commands
+  sending command changesetdata: {
+'fields': set([
+  'bookmarks',
+  'parents',
+  'phase',
+  'revision'
+]),
+'noderange': [
+  [],
+  [
+'\xca\xa2\xa4eE\x1d\xd1\xfa\xcd\xa0\xf5\xb1#\x12\xc3UXA\x88\xa1',
+'\xcd%4vk\xec\xe18\xc7\xc1\xaf\xdch%0/\x0fb\xd8\x1f'
+  ]
+]
+  }
+  received frame(size=11; request=1; stream=2; streamflags=stream-begin; 
type=command-response; flags=continuation)
+  received frame(size=909; request=1; stream=2; streamflags=; 
type=command-response; flags=continuation)
+  received frame(size=0; request=1; stream=2; streamflags=; 
type=command-response; flags=eos)
+  add changeset 3390ef850073
+  add changeset 4432d83626e8
+  add changeset cd2534766bec
+  add changeset e96ae20f4188
+  add changeset caa2a465451d
+  checking for updated bookmarks
+  adding remote bookmark book-1
+  adding remote bookmark book-2
+  updating the branch cache
+  new changesets 3390ef850073:caa2a465451d
+
+  $ hg -R client-bookmarks