##// END OF EJS Templates
streamclone: add support for bundle2 based stream clone...
Boris Feld -
r35781:7eedbd5d default
parent child Browse files
Show More
@@ -1487,6 +1487,7 b" capabilities = {'HG20': (),"
1487 'remote-changegroup': ('http', 'https'),
1487 'remote-changegroup': ('http', 'https'),
1488 'hgtagsfnodes': (),
1488 'hgtagsfnodes': (),
1489 'phases': ('heads',),
1489 'phases': ('heads',),
1490 'stream': ('v2',),
1490 }
1491 }
1491
1492
1492 def getrepocaps(repo, allowpushback=False):
1493 def getrepocaps(repo, allowpushback=False):
@@ -1507,6 +1508,8 b' def getrepocaps(repo, allowpushback=Fals'
1507 caps['checkheads'] = ('related',)
1508 caps['checkheads'] = ('related',)
1508 if 'phases' in repo.ui.configlist('devel', 'legacy.exchange'):
1509 if 'phases' in repo.ui.configlist('devel', 'legacy.exchange'):
1509 caps.pop('phases')
1510 caps.pop('phases')
1511 if not repo.ui.configbool('experimental', 'bundle2.stream'):
1512 caps.pop('stream')
1510 return caps
1513 return caps
1511
1514
1512 def bundle2caps(remote):
1515 def bundle2caps(remote):
@@ -431,6 +431,9 b" coreconfigitem('experimental', 'bundle2-"
431 coreconfigitem('experimental', 'bundle2.pushback',
431 coreconfigitem('experimental', 'bundle2.pushback',
432 default=False,
432 default=False,
433 )
433 )
434 coreconfigitem('experimental', 'bundle2.stream',
435 default=False,
436 )
434 coreconfigitem('experimental', 'bundle2lazylocking',
437 coreconfigitem('experimental', 'bundle2lazylocking',
435 default=False,
438 default=False,
436 )
439 )
@@ -1455,13 +1455,18 b' def _pullbundle2(pullop):'
1455
1455
1456 # At the moment we don't do stream clones over bundle2. If that is
1456 # At the moment we don't do stream clones over bundle2. If that is
1457 # implemented then here's where the check for that will go.
1457 # implemented then here's where the check for that will go.
1458 streaming = False
1458 streaming = streamclone.canperformstreamclone(pullop, bundle2=True)[0]
1459
1459
1460 # declare pull perimeters
1460 # declare pull perimeters
1461 kwargs['common'] = pullop.common
1461 kwargs['common'] = pullop.common
1462 kwargs['heads'] = pullop.heads or pullop.rheads
1462 kwargs['heads'] = pullop.heads or pullop.rheads
1463
1463
1464 if True:
1464 if streaming:
1465 kwargs['cg'] = False
1466 kwargs['stream'] = True
1467 pullop.stepsdone.add('changegroup')
1468
1469 else:
1465 # pulling changegroup
1470 # pulling changegroup
1466 pullop.stepsdone.add('changegroup')
1471 pullop.stepsdone.add('changegroup')
1467
1472
@@ -1,5 +1,14 b''
1 #require serve
1 #require serve
2
2
3 #testcases stream-legacy stream-bundle2
4
5 #if stream-bundle2
6 $ cat << EOF >> $HGRCPATH
7 > [experimental]
8 > bundle2.stream = yes
9 > EOF
10 #endif
11
3 Initialize repository
12 Initialize repository
4 the status call is to check for issue5130
13 the status call is to check for issue5130
5
14
@@ -18,24 +27,41 b' the status call is to check for issue513'
18
27
19 Basic clone
28 Basic clone
20
29
30 #if stream-legacy
21 $ hg clone --stream -U http://localhost:$HGPORT clone1
31 $ hg clone --stream -U http://localhost:$HGPORT clone1
22 streaming all changes
32 streaming all changes
23 1027 files to transfer, 96.3 KB of data
33 1027 files to transfer, 96.3 KB of data
24 transferred 96.3 KB in * seconds (*/sec) (glob)
34 transferred 96.3 KB in * seconds (*/sec) (glob)
25 searching for changes
35 searching for changes
26 no changes found
36 no changes found
37 #endif
38 #if stream-bundle2
39 $ hg clone --stream -U http://localhost:$HGPORT clone1
40 streaming all changes
41 1027 files to transfer, 96.3 KB of data
42 transferred 96.3 KB in * seconds (* */sec) (glob)
43 #endif
27
44
28 --uncompressed is an alias to --stream
45 --uncompressed is an alias to --stream
29
46
47 #if stream-legacy
30 $ hg clone --uncompressed -U http://localhost:$HGPORT clone1-uncompressed
48 $ hg clone --uncompressed -U http://localhost:$HGPORT clone1-uncompressed
31 streaming all changes
49 streaming all changes
32 1027 files to transfer, 96.3 KB of data
50 1027 files to transfer, 96.3 KB of data
33 transferred 96.3 KB in * seconds (*/sec) (glob)
51 transferred 96.3 KB in * seconds (*/sec) (glob)
34 searching for changes
52 searching for changes
35 no changes found
53 no changes found
54 #endif
55 #if stream-bundle2
56 $ hg clone --uncompressed -U http://localhost:$HGPORT clone1-uncompressed
57 streaming all changes
58 1027 files to transfer, 96.3 KB of data
59 transferred 96.3 KB in * seconds (* */sec) (glob)
60 #endif
36
61
37 Clone with background file closing enabled
62 Clone with background file closing enabled
38
63
64 #if stream-legacy
39 $ hg --debug --config worker.backgroundclose=true --config worker.backgroundcloseminfilecount=1 clone --stream -U http://localhost:$HGPORT clone-background | grep -v adding
65 $ hg --debug --config worker.backgroundclose=true --config worker.backgroundcloseminfilecount=1 clone --stream -U http://localhost:$HGPORT clone-background | grep -v adding
40 using http://localhost:$HGPORT/
66 using http://localhost:$HGPORT/
41 sending capabilities command
67 sending capabilities command
@@ -57,6 +83,28 b' Clone with background file closing enabl'
57 bundle2-input-part: total payload size 24
83 bundle2-input-part: total payload size 24
58 bundle2-input-bundle: 1 parts total
84 bundle2-input-bundle: 1 parts total
59 checking for updated bookmarks
85 checking for updated bookmarks
86 #endif
87 #if stream-bundle2
88 $ hg --debug --config worker.backgroundclose=true --config worker.backgroundcloseminfilecount=1 clone --stream -U http://localhost:$HGPORT clone-background | grep -v adding
89 using http://localhost:$HGPORT/
90 sending capabilities command
91 query 1; heads
92 sending batch command
93 streaming all changes
94 sending getbundle command
95 bundle2-input-bundle: with-transaction
96 bundle2-input-part: "stream" (params: 4 mandatory) supported
97 applying stream bundle
98 1027 files to transfer, 96.3 KB of data
99 starting 4 threads for background file closing
100 transferred 96.3 KB in * seconds (* */sec) (glob)
101 bundle2-input-part: total payload size 110887
102 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
103 bundle2-input-part: "phase-heads" supported
104 bundle2-input-part: total payload size 24
105 bundle2-input-bundle: 2 parts total
106 checking for updated bookmarks
107 #endif
60
108
61 Cannot stream clone when there are secret changesets
109 Cannot stream clone when there are secret changesets
62
110
@@ -79,12 +127,20 b' Streaming of secrets can be overridden b'
79 $ cat hg.pid > $DAEMON_PIDS
127 $ cat hg.pid > $DAEMON_PIDS
80 $ cd ..
128 $ cd ..
81
129
130 #if stream-legacy
82 $ hg clone --stream -U http://localhost:$HGPORT secret-allowed
131 $ hg clone --stream -U http://localhost:$HGPORT secret-allowed
83 streaming all changes
132 streaming all changes
84 1027 files to transfer, 96.3 KB of data
133 1027 files to transfer, 96.3 KB of data
85 transferred 96.3 KB in * seconds (*/sec) (glob)
134 transferred 96.3 KB in * seconds (*/sec) (glob)
86 searching for changes
135 searching for changes
87 no changes found
136 no changes found
137 #endif
138 #if stream-bundle2
139 $ hg clone --stream -U http://localhost:$HGPORT secret-allowed
140 streaming all changes
141 1027 files to transfer, 96.3 KB of data
142 transferred 96.3 KB in * seconds (* */sec) (glob)
143 #endif
88
144
89 $ killdaemons.py
145 $ killdaemons.py
90
146
@@ -186,6 +242,7 b' add a bookmark'
186
242
187 clone it
243 clone it
188
244
245 #if stream-legacy
189 $ hg clone --stream http://localhost:$HGPORT with-bookmarks
246 $ hg clone --stream http://localhost:$HGPORT with-bookmarks
190 streaming all changes
247 streaming all changes
191 1027 files to transfer, 96.3 KB of data
248 1027 files to transfer, 96.3 KB of data
@@ -194,5 +251,14 b' clone it'
194 no changes found
251 no changes found
195 updating to branch default
252 updating to branch default
196 1025 files updated, 0 files merged, 0 files removed, 0 files unresolved
253 1025 files updated, 0 files merged, 0 files removed, 0 files unresolved
254 #endif
255 #if stream-bundle2
256 $ hg clone --stream http://localhost:$HGPORT with-bookmarks
257 streaming all changes
258 1027 files to transfer, 96.3 KB of data
259 transferred 96.3 KB in * seconds (* */sec) (glob)
260 updating to branch default
261 1025 files updated, 0 files merged, 0 files removed, 0 files unresolved
262 #endif
197 $ hg -R with-bookmarks bookmarks
263 $ hg -R with-bookmarks bookmarks
198 some-bookmark 1:c17445101a72
264 some-bookmark 1:c17445101a72
General Comments 0
You need to be logged in to leave comments. Login now