##// END OF EJS Templates
exchangev2: fetch and apply bookmarks...
Gregory Szorc -
r39671:349482d7 default
parent child Browse files
Show More
@@ -1,167 +1,178 b''
1 # exchangev2.py - repository exchange for wire protocol version 2
1 # exchangev2.py - repository exchange for wire protocol version 2
2 #
2 #
3 # Copyright 2018 Gregory Szorc <gregory.szorc@gmail.com>
3 # Copyright 2018 Gregory Szorc <gregory.szorc@gmail.com>
4 #
4 #
5 # This software may be used and distributed according to the terms of the
5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2 or any later version.
6 # GNU General Public License version 2 or any later version.
7
7
8 from __future__ import absolute_import
8 from __future__ import absolute_import
9
9
10 import weakref
10 import weakref
11
11
12 from .i18n import _
12 from .i18n import _
13 from .node import (
13 from .node import (
14 nullid,
14 nullid,
15 short,
15 short,
16 )
16 )
17 from . import (
17 from . import (
18 bookmarks,
18 mdiff,
19 mdiff,
19 phases,
20 phases,
20 pycompat,
21 pycompat,
21 setdiscovery,
22 setdiscovery,
22 )
23 )
23
24
24 def pull(pullop):
25 def pull(pullop):
25 """Pull using wire protocol version 2."""
26 """Pull using wire protocol version 2."""
26 repo = pullop.repo
27 repo = pullop.repo
27 remote = pullop.remote
28 remote = pullop.remote
28 tr = pullop.trmanager.transaction()
29 tr = pullop.trmanager.transaction()
29
30
30 # Figure out what needs to be fetched.
31 # Figure out what needs to be fetched.
31 common, fetch, remoteheads = _pullchangesetdiscovery(
32 common, fetch, remoteheads = _pullchangesetdiscovery(
32 repo, remote, pullop.heads, abortwhenunrelated=pullop.force)
33 repo, remote, pullop.heads, abortwhenunrelated=pullop.force)
33
34
34 # And fetch the data.
35 # And fetch the data.
35 pullheads = pullop.heads or remoteheads
36 pullheads = pullop.heads or remoteheads
36 csetres = _fetchchangesets(repo, tr, remote, common, fetch, pullheads)
37 csetres = _fetchchangesets(repo, tr, remote, common, fetch, pullheads)
37
38
38 # New revisions are written to the changelog. But all other updates
39 # New revisions are written to the changelog. But all other updates
39 # are deferred. Do those now.
40 # are deferred. Do those now.
40
41
41 # Ensure all new changesets are draft by default. If the repo is
42 # Ensure all new changesets are draft by default. If the repo is
42 # publishing, the phase will be adjusted by the loop below.
43 # publishing, the phase will be adjusted by the loop below.
43 if csetres['added']:
44 if csetres['added']:
44 phases.registernew(repo, tr, phases.draft, csetres['added'])
45 phases.registernew(repo, tr, phases.draft, csetres['added'])
45
46
46 # And adjust the phase of all changesets accordingly.
47 # And adjust the phase of all changesets accordingly.
47 for phase in phases.phasenames:
48 for phase in phases.phasenames:
48 if phase == b'secret' or not csetres['nodesbyphase'][phase]:
49 if phase == b'secret' or not csetres['nodesbyphase'][phase]:
49 continue
50 continue
50
51
51 phases.advanceboundary(repo, tr, phases.phasenames.index(phase),
52 phases.advanceboundary(repo, tr, phases.phasenames.index(phase),
52 csetres['nodesbyphase'][phase])
53 csetres['nodesbyphase'][phase])
53
54
55 # Write bookmark updates.
56 bookmarks.updatefromremote(repo.ui, repo, csetres['bookmarks'],
57 remote.url(), pullop.gettransaction,
58 explicit=pullop.explicitbookmarks)
59
54 def _pullchangesetdiscovery(repo, remote, heads, abortwhenunrelated=True):
60 def _pullchangesetdiscovery(repo, remote, heads, abortwhenunrelated=True):
55 """Determine which changesets need to be pulled."""
61 """Determine which changesets need to be pulled."""
56
62
57 if heads:
63 if heads:
58 knownnode = repo.changelog.hasnode
64 knownnode = repo.changelog.hasnode
59 if all(knownnode(head) for head in heads):
65 if all(knownnode(head) for head in heads):
60 return heads, False, heads
66 return heads, False, heads
61
67
62 # TODO wire protocol version 2 is capable of more efficient discovery
68 # TODO wire protocol version 2 is capable of more efficient discovery
63 # than setdiscovery. Consider implementing something better.
69 # than setdiscovery. Consider implementing something better.
64 common, fetch, remoteheads = setdiscovery.findcommonheads(
70 common, fetch, remoteheads = setdiscovery.findcommonheads(
65 repo.ui, repo, remote, abortwhenunrelated=abortwhenunrelated)
71 repo.ui, repo, remote, abortwhenunrelated=abortwhenunrelated)
66
72
67 common = set(common)
73 common = set(common)
68 remoteheads = set(remoteheads)
74 remoteheads = set(remoteheads)
69
75
70 # If a remote head is filtered locally, put it back in the common set.
76 # If a remote head is filtered locally, put it back in the common set.
71 # See the comment in exchange._pulldiscoverychangegroup() for more.
77 # See the comment in exchange._pulldiscoverychangegroup() for more.
72
78
73 if fetch and remoteheads:
79 if fetch and remoteheads:
74 nodemap = repo.unfiltered().changelog.nodemap
80 nodemap = repo.unfiltered().changelog.nodemap
75
81
76 common |= {head for head in remoteheads if head in nodemap}
82 common |= {head for head in remoteheads if head in nodemap}
77
83
78 if set(remoteheads).issubset(common):
84 if set(remoteheads).issubset(common):
79 fetch = []
85 fetch = []
80
86
81 common.discard(nullid)
87 common.discard(nullid)
82
88
83 return common, fetch, remoteheads
89 return common, fetch, remoteheads
84
90
85 def _fetchchangesets(repo, tr, remote, common, fetch, remoteheads):
91 def _fetchchangesets(repo, tr, remote, common, fetch, remoteheads):
86 # TODO consider adding a step here where we obtain the DAG shape first
92 # TODO consider adding a step here where we obtain the DAG shape first
87 # (or ask the server to slice changesets into chunks for us) so that
93 # (or ask the server to slice changesets into chunks for us) so that
88 # we can perform multiple fetches in batches. This will facilitate
94 # we can perform multiple fetches in batches. This will facilitate
89 # resuming interrupted clones, higher server-side cache hit rates due
95 # resuming interrupted clones, higher server-side cache hit rates due
90 # to smaller segments, etc.
96 # to smaller segments, etc.
91 with remote.commandexecutor() as e:
97 with remote.commandexecutor() as e:
92 objs = e.callcommand(b'changesetdata', {
98 objs = e.callcommand(b'changesetdata', {
93 b'noderange': [sorted(common), sorted(remoteheads)],
99 b'noderange': [sorted(common), sorted(remoteheads)],
94 b'fields': {b'parents', b'phase', b'revision'},
100 b'fields': {b'bookmarks', b'parents', b'phase', b'revision'},
95 }).result()
101 }).result()
96
102
97 # The context manager waits on all response data when exiting. So
103 # The context manager waits on all response data when exiting. So
98 # we need to remain in the context manager in order to stream data.
104 # we need to remain in the context manager in order to stream data.
99 return _processchangesetdata(repo, tr, objs)
105 return _processchangesetdata(repo, tr, objs)
100
106
101 def _processchangesetdata(repo, tr, objs):
107 def _processchangesetdata(repo, tr, objs):
102 repo.hook('prechangegroup', throw=True,
108 repo.hook('prechangegroup', throw=True,
103 **pycompat.strkwargs(tr.hookargs))
109 **pycompat.strkwargs(tr.hookargs))
104
110
105 urepo = repo.unfiltered()
111 urepo = repo.unfiltered()
106 cl = urepo.changelog
112 cl = urepo.changelog
107
113
108 cl.delayupdate(tr)
114 cl.delayupdate(tr)
109
115
110 # The first emitted object is a header describing the data that
116 # The first emitted object is a header describing the data that
111 # follows.
117 # follows.
112 meta = next(objs)
118 meta = next(objs)
113
119
114 progress = repo.ui.makeprogress(_('changesets'),
120 progress = repo.ui.makeprogress(_('changesets'),
115 unit=_('chunks'),
121 unit=_('chunks'),
116 total=meta.get(b'totalitems'))
122 total=meta.get(b'totalitems'))
117
123
118 def linkrev(node):
124 def linkrev(node):
119 repo.ui.debug('add changeset %s\n' % short(node))
125 repo.ui.debug('add changeset %s\n' % short(node))
120 # Linkrev for changelog is always self.
126 # Linkrev for changelog is always self.
121 return len(cl)
127 return len(cl)
122
128
123 def onchangeset(cl, node):
129 def onchangeset(cl, node):
124 progress.increment()
130 progress.increment()
125
131
126 nodesbyphase = {phase: set() for phase in phases.phasenames}
132 nodesbyphase = {phase: set() for phase in phases.phasenames}
133 remotebookmarks = {}
127
134
128 # addgroup() expects a 7-tuple describing revisions. This normalizes
135 # addgroup() expects a 7-tuple describing revisions. This normalizes
129 # the wire data to that format.
136 # the wire data to that format.
130 #
137 #
131 # This loop also aggregates non-revision metadata, such as phase
138 # This loop also aggregates non-revision metadata, such as phase
132 # data.
139 # data.
133 def iterrevisions():
140 def iterrevisions():
134 for cset in objs:
141 for cset in objs:
135 node = cset[b'node']
142 node = cset[b'node']
136
143
137 if b'phase' in cset:
144 if b'phase' in cset:
138 nodesbyphase[cset[b'phase']].add(node)
145 nodesbyphase[cset[b'phase']].add(node)
139
146
147 for mark in cset.get(b'bookmarks', []):
148 remotebookmarks[mark] = node
149
140 # Some entries might only be metadata only updates.
150 # Some entries might only be metadata only updates.
141 if b'revisionsize' not in cset:
151 if b'revisionsize' not in cset:
142 continue
152 continue
143
153
144 data = next(objs)
154 data = next(objs)
145
155
146 yield (
156 yield (
147 node,
157 node,
148 cset[b'parents'][0],
158 cset[b'parents'][0],
149 cset[b'parents'][1],
159 cset[b'parents'][1],
150 # Linknode is always itself for changesets.
160 # Linknode is always itself for changesets.
151 cset[b'node'],
161 cset[b'node'],
152 # We always send full revisions. So delta base is not set.
162 # We always send full revisions. So delta base is not set.
153 nullid,
163 nullid,
154 mdiff.trivialdiffheader(len(data)) + data,
164 mdiff.trivialdiffheader(len(data)) + data,
155 # Flags not yet supported.
165 # Flags not yet supported.
156 0,
166 0,
157 )
167 )
158
168
159 added = cl.addgroup(iterrevisions(), linkrev, weakref.proxy(tr),
169 added = cl.addgroup(iterrevisions(), linkrev, weakref.proxy(tr),
160 addrevisioncb=onchangeset)
170 addrevisioncb=onchangeset)
161
171
162 progress.complete()
172 progress.complete()
163
173
164 return {
174 return {
165 'added': added,
175 'added': added,
166 'nodesbyphase': nodesbyphase,
176 'nodesbyphase': nodesbyphase,
177 'bookmarks': remotebookmarks,
167 }
178 }
@@ -1,277 +1,395 b''
1 Tests for wire protocol version 2 exchange.
1 Tests for wire protocol version 2 exchange.
2 Tests in this file should be folded into existing tests once protocol
2 Tests in this file should be folded into existing tests once protocol
3 v2 has enough features that it can be enabled via #testcase in existing
3 v2 has enough features that it can be enabled via #testcase in existing
4 tests.
4 tests.
5
5
6 $ . $TESTDIR/wireprotohelpers.sh
6 $ . $TESTDIR/wireprotohelpers.sh
7 $ enablehttpv2client
7 $ enablehttpv2client
8
8
9 $ hg init server-simple
9 $ hg init server-simple
10 $ enablehttpv2 server-simple
10 $ enablehttpv2 server-simple
11 $ cd server-simple
11 $ cd server-simple
12 $ cat >> .hg/hgrc << EOF
12 $ cat >> .hg/hgrc << EOF
13 > [phases]
13 > [phases]
14 > publish = false
14 > publish = false
15 > EOF
15 > EOF
16 $ echo a0 > a
16 $ echo a0 > a
17 $ echo b0 > b
17 $ echo b0 > b
18 $ hg -q commit -A -m 'commit 0'
18 $ hg -q commit -A -m 'commit 0'
19
19
20 $ echo a1 > a
20 $ echo a1 > a
21 $ hg commit -m 'commit 1'
21 $ hg commit -m 'commit 1'
22 $ hg phase --public -r .
22 $ hg phase --public -r .
23 $ echo a2 > a
23 $ echo a2 > a
24 $ hg commit -m 'commit 2'
24 $ hg commit -m 'commit 2'
25
25
26 $ hg -q up -r 0
26 $ hg -q up -r 0
27 $ echo b1 > b
27 $ echo b1 > b
28 $ hg -q commit -m 'head 2 commit 1'
28 $ hg -q commit -m 'head 2 commit 1'
29 $ echo b2 > b
29 $ echo b2 > b
30 $ hg -q commit -m 'head 2 commit 2'
30 $ hg -q commit -m 'head 2 commit 2'
31
31
32 $ hg serve -p $HGPORT -d --pid-file hg.pid -E error.log
32 $ hg serve -p $HGPORT -d --pid-file hg.pid -E error.log
33 $ cat hg.pid > $DAEMON_PIDS
33 $ cat hg.pid > $DAEMON_PIDS
34
34
35 $ cd ..
35 $ cd ..
36
36
37 Test basic clone
37 Test basic clone
38
38
39 $ hg --debug clone -U http://localhost:$HGPORT client-simple
39 $ hg --debug clone -U http://localhost:$HGPORT client-simple
40 using http://localhost:$HGPORT/
40 using http://localhost:$HGPORT/
41 sending capabilities command
41 sending capabilities command
42 query 1; heads
42 query 1; heads
43 sending 2 commands
43 sending 2 commands
44 sending command heads: {}
44 sending command heads: {}
45 sending command known: {
45 sending command known: {
46 'nodes': []
46 'nodes': []
47 }
47 }
48 received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation)
48 received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation)
49 received frame(size=43; request=1; stream=2; streamflags=; type=command-response; flags=continuation)
49 received frame(size=43; request=1; stream=2; streamflags=; type=command-response; flags=continuation)
50 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
50 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
51 received frame(size=11; request=3; stream=2; streamflags=; type=command-response; flags=continuation)
51 received frame(size=11; request=3; stream=2; streamflags=; type=command-response; flags=continuation)
52 received frame(size=1; request=3; stream=2; streamflags=; type=command-response; flags=continuation)
52 received frame(size=1; request=3; stream=2; streamflags=; type=command-response; flags=continuation)
53 received frame(size=0; request=3; stream=2; streamflags=; type=command-response; flags=eos)
53 received frame(size=0; request=3; stream=2; streamflags=; type=command-response; flags=eos)
54 sending 1 commands
54 sending 1 commands
55 sending command changesetdata: {
55 sending command changesetdata: {
56 'fields': set([
56 'fields': set([
57 'bookmarks',
57 'parents',
58 'parents',
58 'phase',
59 'phase',
59 'revision'
60 'revision'
60 ]),
61 ]),
61 'noderange': [
62 'noderange': [
62 [],
63 [],
63 [
64 [
64 '\xca\xa2\xa4eE\x1d\xd1\xfa\xcd\xa0\xf5\xb1#\x12\xc3UXA\x88\xa1',
65 '\xca\xa2\xa4eE\x1d\xd1\xfa\xcd\xa0\xf5\xb1#\x12\xc3UXA\x88\xa1',
65 '\xcd%4vk\xec\xe18\xc7\xc1\xaf\xdch%0/\x0fb\xd8\x1f'
66 '\xcd%4vk\xec\xe18\xc7\xc1\xaf\xdch%0/\x0fb\xd8\x1f'
66 ]
67 ]
67 ]
68 ]
68 }
69 }
69 received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation)
70 received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation)
70 received frame(size=871; request=1; stream=2; streamflags=; type=command-response; flags=continuation)
71 received frame(size=871; request=1; stream=2; streamflags=; type=command-response; flags=continuation)
71 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
72 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
72 add changeset 3390ef850073
73 add changeset 3390ef850073
73 add changeset 4432d83626e8
74 add changeset 4432d83626e8
74 add changeset cd2534766bec
75 add changeset cd2534766bec
75 add changeset e96ae20f4188
76 add changeset e96ae20f4188
76 add changeset caa2a465451d
77 add changeset caa2a465451d
78 checking for updated bookmarks
77 updating the branch cache
79 updating the branch cache
78 new changesets 3390ef850073:caa2a465451d (3 drafts)
80 new changesets 3390ef850073:caa2a465451d (3 drafts)
79
81
80 All changesets should have been transferred
82 All changesets should have been transferred
81
83
82 $ hg -R client-simple debugindex -c
84 $ hg -R client-simple debugindex -c
83 rev linkrev nodeid p1 p2
85 rev linkrev nodeid p1 p2
84 0 0 3390ef850073 000000000000 000000000000
86 0 0 3390ef850073 000000000000 000000000000
85 1 1 4432d83626e8 3390ef850073 000000000000
87 1 1 4432d83626e8 3390ef850073 000000000000
86 2 2 cd2534766bec 4432d83626e8 000000000000
88 2 2 cd2534766bec 4432d83626e8 000000000000
87 3 3 e96ae20f4188 3390ef850073 000000000000
89 3 3 e96ae20f4188 3390ef850073 000000000000
88 4 4 caa2a465451d e96ae20f4188 000000000000
90 4 4 caa2a465451d e96ae20f4188 000000000000
89
91
90 $ hg -R client-simple log -G -T '{rev} {node} {phase}\n'
92 $ hg -R client-simple log -G -T '{rev} {node} {phase}\n'
91 o 4 caa2a465451dd1facda0f5b12312c355584188a1 draft
93 o 4 caa2a465451dd1facda0f5b12312c355584188a1 draft
92 |
94 |
93 o 3 e96ae20f4188487b9ae4ef3941c27c81143146e5 draft
95 o 3 e96ae20f4188487b9ae4ef3941c27c81143146e5 draft
94 |
96 |
95 | o 2 cd2534766bece138c7c1afdc6825302f0f62d81f draft
97 | o 2 cd2534766bece138c7c1afdc6825302f0f62d81f draft
96 | |
98 | |
97 | o 1 4432d83626e8a98655f062ec1f2a43b07f7fbbb0 public
99 | o 1 4432d83626e8a98655f062ec1f2a43b07f7fbbb0 public
98 |/
100 |/
99 o 0 3390ef850073fbc2f0dfff2244342c8e9229013a public
101 o 0 3390ef850073fbc2f0dfff2244342c8e9229013a public
100
102
101
103
102 Cloning only a specific revision works
104 Cloning only a specific revision works
103
105
104 $ hg --debug clone -U -r 4432d83626e8 http://localhost:$HGPORT client-singlehead
106 $ hg --debug clone -U -r 4432d83626e8 http://localhost:$HGPORT client-singlehead
105 using http://localhost:$HGPORT/
107 using http://localhost:$HGPORT/
106 sending capabilities command
108 sending capabilities command
107 sending 1 commands
109 sending 1 commands
108 sending command lookup: {
110 sending command lookup: {
109 'key': '4432d83626e8'
111 'key': '4432d83626e8'
110 }
112 }
111 received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation)
113 received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation)
112 received frame(size=21; request=1; stream=2; streamflags=; type=command-response; flags=continuation)
114 received frame(size=21; request=1; stream=2; streamflags=; type=command-response; flags=continuation)
113 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
115 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
114 query 1; heads
116 query 1; heads
115 sending 2 commands
117 sending 2 commands
116 sending command heads: {}
118 sending command heads: {}
117 sending command known: {
119 sending command known: {
118 'nodes': []
120 'nodes': []
119 }
121 }
120 received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation)
122 received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation)
121 received frame(size=43; request=1; stream=2; streamflags=; type=command-response; flags=continuation)
123 received frame(size=43; request=1; stream=2; streamflags=; type=command-response; flags=continuation)
122 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
124 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
123 received frame(size=11; request=3; stream=2; streamflags=; type=command-response; flags=continuation)
125 received frame(size=11; request=3; stream=2; streamflags=; type=command-response; flags=continuation)
124 received frame(size=1; request=3; stream=2; streamflags=; type=command-response; flags=continuation)
126 received frame(size=1; request=3; stream=2; streamflags=; type=command-response; flags=continuation)
125 received frame(size=0; request=3; stream=2; streamflags=; type=command-response; flags=eos)
127 received frame(size=0; request=3; stream=2; streamflags=; type=command-response; flags=eos)
126 sending 1 commands
128 sending 1 commands
127 sending command changesetdata: {
129 sending command changesetdata: {
128 'fields': set([
130 'fields': set([
131 'bookmarks',
129 'parents',
132 'parents',
130 'phase',
133 'phase',
131 'revision'
134 'revision'
132 ]),
135 ]),
133 'noderange': [
136 'noderange': [
134 [],
137 [],
135 [
138 [
136 'D2\xd86&\xe8\xa9\x86U\xf0b\xec\x1f*C\xb0\x7f\x7f\xbb\xb0'
139 'D2\xd86&\xe8\xa9\x86U\xf0b\xec\x1f*C\xb0\x7f\x7f\xbb\xb0'
137 ]
140 ]
138 ]
141 ]
139 }
142 }
140 received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation)
143 received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation)
141 received frame(size=353; request=1; stream=2; streamflags=; type=command-response; flags=continuation)
144 received frame(size=353; request=1; stream=2; streamflags=; type=command-response; flags=continuation)
142 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
145 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
143 add changeset 3390ef850073
146 add changeset 3390ef850073
144 add changeset 4432d83626e8
147 add changeset 4432d83626e8
148 checking for updated bookmarks
145 updating the branch cache
149 updating the branch cache
146 new changesets 3390ef850073:4432d83626e8
150 new changesets 3390ef850073:4432d83626e8
147
151
148 $ cd client-singlehead
152 $ cd client-singlehead
149
153
150 $ hg log -G -T '{rev} {node} {phase}\n'
154 $ hg log -G -T '{rev} {node} {phase}\n'
151 o 1 4432d83626e8a98655f062ec1f2a43b07f7fbbb0 public
155 o 1 4432d83626e8a98655f062ec1f2a43b07f7fbbb0 public
152 |
156 |
153 o 0 3390ef850073fbc2f0dfff2244342c8e9229013a public
157 o 0 3390ef850073fbc2f0dfff2244342c8e9229013a public
154
158
155
159
156 Incremental pull works
160 Incremental pull works
157
161
158 $ hg --debug pull
162 $ hg --debug pull
159 pulling from http://localhost:$HGPORT/
163 pulling from http://localhost:$HGPORT/
160 using http://localhost:$HGPORT/
164 using http://localhost:$HGPORT/
161 sending capabilities command
165 sending capabilities command
162 query 1; heads
166 query 1; heads
163 sending 2 commands
167 sending 2 commands
164 sending command heads: {}
168 sending command heads: {}
165 sending command known: {
169 sending command known: {
166 'nodes': [
170 'nodes': [
167 'D2\xd86&\xe8\xa9\x86U\xf0b\xec\x1f*C\xb0\x7f\x7f\xbb\xb0'
171 'D2\xd86&\xe8\xa9\x86U\xf0b\xec\x1f*C\xb0\x7f\x7f\xbb\xb0'
168 ]
172 ]
169 }
173 }
170 received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation)
174 received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation)
171 received frame(size=43; request=1; stream=2; streamflags=; type=command-response; flags=continuation)
175 received frame(size=43; request=1; stream=2; streamflags=; type=command-response; flags=continuation)
172 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
176 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
173 received frame(size=11; request=3; stream=2; streamflags=; type=command-response; flags=continuation)
177 received frame(size=11; request=3; stream=2; streamflags=; type=command-response; flags=continuation)
174 received frame(size=2; request=3; stream=2; streamflags=; type=command-response; flags=continuation)
178 received frame(size=2; request=3; stream=2; streamflags=; type=command-response; flags=continuation)
175 received frame(size=0; request=3; stream=2; streamflags=; type=command-response; flags=eos)
179 received frame(size=0; request=3; stream=2; streamflags=; type=command-response; flags=eos)
176 searching for changes
180 searching for changes
177 all local heads known remotely
181 all local heads known remotely
178 sending 1 commands
182 sending 1 commands
179 sending command changesetdata: {
183 sending command changesetdata: {
180 'fields': set([
184 'fields': set([
185 'bookmarks',
181 'parents',
186 'parents',
182 'phase',
187 'phase',
183 'revision'
188 'revision'
184 ]),
189 ]),
185 'noderange': [
190 'noderange': [
186 [
191 [
187 'D2\xd86&\xe8\xa9\x86U\xf0b\xec\x1f*C\xb0\x7f\x7f\xbb\xb0'
192 'D2\xd86&\xe8\xa9\x86U\xf0b\xec\x1f*C\xb0\x7f\x7f\xbb\xb0'
188 ],
193 ],
189 [
194 [
190 '\xca\xa2\xa4eE\x1d\xd1\xfa\xcd\xa0\xf5\xb1#\x12\xc3UXA\x88\xa1',
195 '\xca\xa2\xa4eE\x1d\xd1\xfa\xcd\xa0\xf5\xb1#\x12\xc3UXA\x88\xa1',
191 '\xcd%4vk\xec\xe18\xc7\xc1\xaf\xdch%0/\x0fb\xd8\x1f'
196 '\xcd%4vk\xec\xe18\xc7\xc1\xaf\xdch%0/\x0fb\xd8\x1f'
192 ]
197 ]
193 ]
198 ]
194 }
199 }
195 received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation)
200 received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation)
196 received frame(size=571; request=1; stream=2; streamflags=; type=command-response; flags=continuation)
201 received frame(size=571; request=1; stream=2; streamflags=; type=command-response; flags=continuation)
197 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
202 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
198 add changeset cd2534766bec
203 add changeset cd2534766bec
199 add changeset e96ae20f4188
204 add changeset e96ae20f4188
200 add changeset caa2a465451d
205 add changeset caa2a465451d
206 checking for updated bookmarks
201 updating the branch cache
207 updating the branch cache
202 new changesets cd2534766bec:caa2a465451d (3 drafts)
208 new changesets cd2534766bec:caa2a465451d (3 drafts)
203 (run 'hg update' to get a working copy)
209 (run 'hg update' to get a working copy)
204
210
205 $ hg log -G -T '{rev} {node} {phase}\n'
211 $ hg log -G -T '{rev} {node} {phase}\n'
206 o 4 caa2a465451dd1facda0f5b12312c355584188a1 draft
212 o 4 caa2a465451dd1facda0f5b12312c355584188a1 draft
207 |
213 |
208 o 3 e96ae20f4188487b9ae4ef3941c27c81143146e5 draft
214 o 3 e96ae20f4188487b9ae4ef3941c27c81143146e5 draft
209 |
215 |
210 | o 2 cd2534766bece138c7c1afdc6825302f0f62d81f draft
216 | o 2 cd2534766bece138c7c1afdc6825302f0f62d81f draft
211 | |
217 | |
212 | o 1 4432d83626e8a98655f062ec1f2a43b07f7fbbb0 public
218 | o 1 4432d83626e8a98655f062ec1f2a43b07f7fbbb0 public
213 |/
219 |/
214 o 0 3390ef850073fbc2f0dfff2244342c8e9229013a public
220 o 0 3390ef850073fbc2f0dfff2244342c8e9229013a public
215
221
216
222
217 Phase-only update works
223 Phase-only update works
218
224
219 $ hg -R ../server-simple phase --public -r caa2a465451dd
225 $ hg -R ../server-simple phase --public -r caa2a465451dd
220 $ hg --debug pull
226 $ hg --debug pull
221 pulling from http://localhost:$HGPORT/
227 pulling from http://localhost:$HGPORT/
222 using http://localhost:$HGPORT/
228 using http://localhost:$HGPORT/
223 sending capabilities command
229 sending capabilities command
224 query 1; heads
230 query 1; heads
225 sending 2 commands
231 sending 2 commands
226 sending command heads: {}
232 sending command heads: {}
227 sending command known: {
233 sending command known: {
228 'nodes': [
234 'nodes': [
229 '\xcd%4vk\xec\xe18\xc7\xc1\xaf\xdch%0/\x0fb\xd8\x1f',
235 '\xcd%4vk\xec\xe18\xc7\xc1\xaf\xdch%0/\x0fb\xd8\x1f',
230 '\xca\xa2\xa4eE\x1d\xd1\xfa\xcd\xa0\xf5\xb1#\x12\xc3UXA\x88\xa1'
236 '\xca\xa2\xa4eE\x1d\xd1\xfa\xcd\xa0\xf5\xb1#\x12\xc3UXA\x88\xa1'
231 ]
237 ]
232 }
238 }
233 received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation)
239 received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation)
234 received frame(size=43; request=1; stream=2; streamflags=; type=command-response; flags=continuation)
240 received frame(size=43; request=1; stream=2; streamflags=; type=command-response; flags=continuation)
235 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
241 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
236 received frame(size=11; request=3; stream=2; streamflags=; type=command-response; flags=continuation)
242 received frame(size=11; request=3; stream=2; streamflags=; type=command-response; flags=continuation)
237 received frame(size=3; request=3; stream=2; streamflags=; type=command-response; flags=continuation)
243 received frame(size=3; request=3; stream=2; streamflags=; type=command-response; flags=continuation)
238 received frame(size=0; request=3; stream=2; streamflags=; type=command-response; flags=eos)
244 received frame(size=0; request=3; stream=2; streamflags=; type=command-response; flags=eos)
239 searching for changes
245 searching for changes
240 all remote heads known locally
246 all remote heads known locally
241 sending 1 commands
247 sending 1 commands
242 sending command changesetdata: {
248 sending command changesetdata: {
243 'fields': set([
249 'fields': set([
250 'bookmarks',
244 'parents',
251 'parents',
245 'phase',
252 'phase',
246 'revision'
253 'revision'
247 ]),
254 ]),
248 'noderange': [
255 'noderange': [
249 [
256 [
250 '\xca\xa2\xa4eE\x1d\xd1\xfa\xcd\xa0\xf5\xb1#\x12\xc3UXA\x88\xa1',
257 '\xca\xa2\xa4eE\x1d\xd1\xfa\xcd\xa0\xf5\xb1#\x12\xc3UXA\x88\xa1',
251 '\xcd%4vk\xec\xe18\xc7\xc1\xaf\xdch%0/\x0fb\xd8\x1f'
258 '\xcd%4vk\xec\xe18\xc7\xc1\xaf\xdch%0/\x0fb\xd8\x1f'
252 ],
259 ],
253 [
260 [
254 '\xca\xa2\xa4eE\x1d\xd1\xfa\xcd\xa0\xf5\xb1#\x12\xc3UXA\x88\xa1',
261 '\xca\xa2\xa4eE\x1d\xd1\xfa\xcd\xa0\xf5\xb1#\x12\xc3UXA\x88\xa1',
255 '\xcd%4vk\xec\xe18\xc7\xc1\xaf\xdch%0/\x0fb\xd8\x1f'
262 '\xcd%4vk\xec\xe18\xc7\xc1\xaf\xdch%0/\x0fb\xd8\x1f'
256 ]
263 ]
257 ]
264 ]
258 }
265 }
259 received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation)
266 received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation)
260 received frame(size=92; request=1; stream=2; streamflags=; type=command-response; flags=continuation)
267 received frame(size=92; request=1; stream=2; streamflags=; type=command-response; flags=continuation)
261 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
268 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
269 checking for updated bookmarks
262 2 local changesets published
270 2 local changesets published
263 (run 'hg update' to get a working copy)
271 (run 'hg update' to get a working copy)
264
272
265 $ hg log -G -T '{rev} {node} {phase}\n'
273 $ hg log -G -T '{rev} {node} {phase}\n'
266 o 4 caa2a465451dd1facda0f5b12312c355584188a1 public
274 o 4 caa2a465451dd1facda0f5b12312c355584188a1 public
267 |
275 |
268 o 3 e96ae20f4188487b9ae4ef3941c27c81143146e5 public
276 o 3 e96ae20f4188487b9ae4ef3941c27c81143146e5 public
269 |
277 |
270 | o 2 cd2534766bece138c7c1afdc6825302f0f62d81f draft
278 | o 2 cd2534766bece138c7c1afdc6825302f0f62d81f draft
271 | |
279 | |
272 | o 1 4432d83626e8a98655f062ec1f2a43b07f7fbbb0 public
280 | o 1 4432d83626e8a98655f062ec1f2a43b07f7fbbb0 public
273 |/
281 |/
274 o 0 3390ef850073fbc2f0dfff2244342c8e9229013a public
282 o 0 3390ef850073fbc2f0dfff2244342c8e9229013a public
275
283
276
284
277 $ cd ..
285 $ cd ..
286
287 Bookmarks are transferred on clone
288
289 $ hg -R server-simple bookmark -r 3390ef850073fbc2f0dfff2244342c8e9229013a book-1
290 $ hg -R server-simple bookmark -r cd2534766bece138c7c1afdc6825302f0f62d81f book-2
291
292 $ hg --debug clone -U http://localhost:$HGPORT/ client-bookmarks
293 using http://localhost:$HGPORT/
294 sending capabilities command
295 query 1; heads
296 sending 2 commands
297 sending command heads: {}
298 sending command known: {
299 'nodes': []
300 }
301 received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation)
302 received frame(size=43; request=1; stream=2; streamflags=; type=command-response; flags=continuation)
303 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
304 received frame(size=11; request=3; stream=2; streamflags=; type=command-response; flags=continuation)
305 received frame(size=1; request=3; stream=2; streamflags=; type=command-response; flags=continuation)
306 received frame(size=0; request=3; stream=2; streamflags=; type=command-response; flags=eos)
307 sending 1 commands
308 sending command changesetdata: {
309 'fields': set([
310 'bookmarks',
311 'parents',
312 'phase',
313 'revision'
314 ]),
315 'noderange': [
316 [],
317 [
318 '\xca\xa2\xa4eE\x1d\xd1\xfa\xcd\xa0\xf5\xb1#\x12\xc3UXA\x88\xa1',
319 '\xcd%4vk\xec\xe18\xc7\xc1\xaf\xdch%0/\x0fb\xd8\x1f'
320 ]
321 ]
322 }
323 received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation)
324 received frame(size=909; request=1; stream=2; streamflags=; type=command-response; flags=continuation)
325 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
326 add changeset 3390ef850073
327 add changeset 4432d83626e8
328 add changeset cd2534766bec
329 add changeset e96ae20f4188
330 add changeset caa2a465451d
331 checking for updated bookmarks
332 adding remote bookmark book-1
333 adding remote bookmark book-2
334 updating the branch cache
335 new changesets 3390ef850073:caa2a465451d (1 drafts)
336
337 $ hg -R client-bookmarks bookmarks
338 book-1 0:3390ef850073
339 book-2 2:cd2534766bec
340
341 Server-side bookmark moves are reflected during `hg pull`
342
343 $ hg -R server-simple bookmark -r cd2534766bece138c7c1afdc6825302f0f62d81f book-1
344 moving bookmark 'book-1' forward from 3390ef850073
345
346 $ hg -R client-bookmarks --debug pull
347 pulling from http://localhost:$HGPORT/
348 using http://localhost:$HGPORT/
349 sending capabilities command
350 query 1; heads
351 sending 2 commands
352 sending command heads: {}
353 sending command known: {
354 'nodes': [
355 '\xcd%4vk\xec\xe18\xc7\xc1\xaf\xdch%0/\x0fb\xd8\x1f',
356 '\xca\xa2\xa4eE\x1d\xd1\xfa\xcd\xa0\xf5\xb1#\x12\xc3UXA\x88\xa1'
357 ]
358 }
359 received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation)
360 received frame(size=43; request=1; stream=2; streamflags=; type=command-response; flags=continuation)
361 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
362 received frame(size=11; request=3; stream=2; streamflags=; type=command-response; flags=continuation)
363 received frame(size=3; request=3; stream=2; streamflags=; type=command-response; flags=continuation)
364 received frame(size=0; request=3; stream=2; streamflags=; type=command-response; flags=eos)
365 searching for changes
366 all remote heads known locally
367 sending 1 commands
368 sending command changesetdata: {
369 'fields': set([
370 'bookmarks',
371 'parents',
372 'phase',
373 'revision'
374 ]),
375 'noderange': [
376 [
377 '\xca\xa2\xa4eE\x1d\xd1\xfa\xcd\xa0\xf5\xb1#\x12\xc3UXA\x88\xa1',
378 '\xcd%4vk\xec\xe18\xc7\xc1\xaf\xdch%0/\x0fb\xd8\x1f'
379 ],
380 [
381 '\xca\xa2\xa4eE\x1d\xd1\xfa\xcd\xa0\xf5\xb1#\x12\xc3UXA\x88\xa1',
382 '\xcd%4vk\xec\xe18\xc7\xc1\xaf\xdch%0/\x0fb\xd8\x1f'
383 ]
384 ]
385 }
386 received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation)
387 received frame(size=144; request=1; stream=2; streamflags=; type=command-response; flags=continuation)
388 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
389 checking for updated bookmarks
390 updating bookmark book-1
391 (run 'hg update' to get a working copy)
392
393 $ hg -R client-bookmarks bookmarks
394 book-1 2:cd2534766bec
395 book-2 2:cd2534766bec
General Comments 0
You need to be logged in to leave comments. Login now