##// 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 1487 'remote-changegroup': ('http', 'https'),
1488 1488 'hgtagsfnodes': (),
1489 1489 'phases': ('heads',),
1490 'stream': ('v2',),
1490 1491 }
1491 1492
1492 1493 def getrepocaps(repo, allowpushback=False):
@@ -1507,6 +1508,8 b' def getrepocaps(repo, allowpushback=Fals'
1507 1508 caps['checkheads'] = ('related',)
1508 1509 if 'phases' in repo.ui.configlist('devel', 'legacy.exchange'):
1509 1510 caps.pop('phases')
1511 if not repo.ui.configbool('experimental', 'bundle2.stream'):
1512 caps.pop('stream')
1510 1513 return caps
1511 1514
1512 1515 def bundle2caps(remote):
@@ -431,6 +431,9 b" coreconfigitem('experimental', 'bundle2-"
431 431 coreconfigitem('experimental', 'bundle2.pushback',
432 432 default=False,
433 433 )
434 coreconfigitem('experimental', 'bundle2.stream',
435 default=False,
436 )
434 437 coreconfigitem('experimental', 'bundle2lazylocking',
435 438 default=False,
436 439 )
@@ -1455,13 +1455,18 b' def _pullbundle2(pullop):'
1455 1455
1456 1456 # At the moment we don't do stream clones over bundle2. If that is
1457 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 1460 # declare pull perimeters
1461 1461 kwargs['common'] = pullop.common
1462 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 1470 # pulling changegroup
1466 1471 pullop.stepsdone.add('changegroup')
1467 1472
@@ -1,5 +1,14 b''
1 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 12 Initialize repository
4 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 28 Basic clone
20 29
30 #if stream-legacy
21 31 $ hg clone --stream -U http://localhost:$HGPORT clone1
22 32 streaming all changes
23 33 1027 files to transfer, 96.3 KB of data
24 34 transferred 96.3 KB in * seconds (*/sec) (glob)
25 35 searching for changes
26 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 45 --uncompressed is an alias to --stream
29 46
47 #if stream-legacy
30 48 $ hg clone --uncompressed -U http://localhost:$HGPORT clone1-uncompressed
31 49 streaming all changes
32 50 1027 files to transfer, 96.3 KB of data
33 51 transferred 96.3 KB in * seconds (*/sec) (glob)
34 52 searching for changes
35 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 62 Clone with background file closing enabled
38 63
64 #if stream-legacy
39 65 $ hg --debug --config worker.backgroundclose=true --config worker.backgroundcloseminfilecount=1 clone --stream -U http://localhost:$HGPORT clone-background | grep -v adding
40 66 using http://localhost:$HGPORT/
41 67 sending capabilities command
@@ -57,6 +83,28 b' Clone with background file closing enabl'
57 83 bundle2-input-part: total payload size 24
58 84 bundle2-input-bundle: 1 parts total
59 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 109 Cannot stream clone when there are secret changesets
62 110
@@ -79,12 +127,20 b' Streaming of secrets can be overridden b'
79 127 $ cat hg.pid > $DAEMON_PIDS
80 128 $ cd ..
81 129
130 #if stream-legacy
82 131 $ hg clone --stream -U http://localhost:$HGPORT secret-allowed
83 132 streaming all changes
84 133 1027 files to transfer, 96.3 KB of data
85 134 transferred 96.3 KB in * seconds (*/sec) (glob)
86 135 searching for changes
87 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 145 $ killdaemons.py
90 146
@@ -186,6 +242,7 b' add a bookmark'
186 242
187 243 clone it
188 244
245 #if stream-legacy
189 246 $ hg clone --stream http://localhost:$HGPORT with-bookmarks
190 247 streaming all changes
191 248 1027 files to transfer, 96.3 KB of data
@@ -194,5 +251,14 b' clone it'
194 251 no changes found
195 252 updating to branch default
196 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 263 $ hg -R with-bookmarks bookmarks
198 264 some-bookmark 1:c17445101a72
General Comments 0
You need to be logged in to leave comments. Login now