##// END OF EJS Templates
revlog-split: show manifest data loss situation when using clonebundle...
marmoute -
r51318:54f68495 stable
parent child Browse files
Show More
@@ -1,640 +1,757 b''
1 #require no-reposimplestore no-chg
1 #require no-reposimplestore no-chg
2
2
3 Set up a server
3 Set up a server
4
4
5 $ hg init server
5 $ hg init server
6 $ cd server
6 $ cd server
7 $ cat >> .hg/hgrc << EOF
7 $ cat >> .hg/hgrc << EOF
8 > [extensions]
8 > [extensions]
9 > clonebundles =
9 > clonebundles =
10 > EOF
10 > EOF
11
11
12 $ touch foo
12 $ touch foo
13 $ hg -q commit -A -m 'add foo'
13 $ hg -q commit -A -m 'add foo'
14 $ touch bar
14 $ touch bar
15 $ hg -q commit -A -m 'add bar'
15 $ hg -q commit -A -m 'add bar'
16
16
17 $ hg serve -d -p $HGPORT --pid-file hg.pid --accesslog access.log
17 $ hg serve -d -p $HGPORT --pid-file hg.pid --accesslog access.log
18 $ cat hg.pid >> $DAEMON_PIDS
18 $ cat hg.pid >> $DAEMON_PIDS
19 $ cd ..
19 $ cd ..
20
20
21 Missing manifest should not result in server lookup
21 Missing manifest should not result in server lookup
22
22
23 $ hg --verbose clone -U http://localhost:$HGPORT no-manifest
23 $ hg --verbose clone -U http://localhost:$HGPORT no-manifest
24 requesting all changes
24 requesting all changes
25 adding changesets
25 adding changesets
26 adding manifests
26 adding manifests
27 adding file changes
27 adding file changes
28 added 2 changesets with 2 changes to 2 files
28 added 2 changesets with 2 changes to 2 files
29 new changesets 53245c60e682:aaff8d2ffbbf
29 new changesets 53245c60e682:aaff8d2ffbbf
30 (sent 3 HTTP requests and * bytes; received * bytes in responses) (glob)
30 (sent 3 HTTP requests and * bytes; received * bytes in responses) (glob)
31
31
32 $ cat server/access.log
32 $ cat server/access.log
33 * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
33 * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
34 $LOCALIP - - [$LOGDATE$] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
34 $LOCALIP - - [$LOGDATE$] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
35 $LOCALIP - - [$LOGDATE$] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=aaff8d2ffbbf07a46dd1f05d8ae7877e3f56e2a2&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
35 $LOCALIP - - [$LOGDATE$] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=aaff8d2ffbbf07a46dd1f05d8ae7877e3f56e2a2&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
36
36
37 Empty manifest file results in retrieval
37 Empty manifest file results in retrieval
38 (the extension only checks if the manifest file exists)
38 (the extension only checks if the manifest file exists)
39
39
40 $ touch server/.hg/clonebundles.manifest
40 $ touch server/.hg/clonebundles.manifest
41 $ hg --verbose clone -U http://localhost:$HGPORT empty-manifest
41 $ hg --verbose clone -U http://localhost:$HGPORT empty-manifest
42 no clone bundles available on remote; falling back to regular clone
42 no clone bundles available on remote; falling back to regular clone
43 requesting all changes
43 requesting all changes
44 adding changesets
44 adding changesets
45 adding manifests
45 adding manifests
46 adding file changes
46 adding file changes
47 added 2 changesets with 2 changes to 2 files
47 added 2 changesets with 2 changes to 2 files
48 new changesets 53245c60e682:aaff8d2ffbbf
48 new changesets 53245c60e682:aaff8d2ffbbf
49 (sent 4 HTTP requests and * bytes; received * bytes in responses) (glob)
49 (sent 4 HTTP requests and * bytes; received * bytes in responses) (glob)
50
50
51 Manifest file with invalid URL aborts
51 Manifest file with invalid URL aborts
52
52
53 $ echo 'http://does.not.exist/bundle.hg' > server/.hg/clonebundles.manifest
53 $ echo 'http://does.not.exist/bundle.hg' > server/.hg/clonebundles.manifest
54 $ hg clone http://localhost:$HGPORT 404-url
54 $ hg clone http://localhost:$HGPORT 404-url
55 applying clone bundle from http://does.not.exist/bundle.hg
55 applying clone bundle from http://does.not.exist/bundle.hg
56 error fetching bundle: (.* not known|(\[Errno -?\d+] )?([Nn]o address associated with (host)?name|Temporary failure in name resolution|Name does not resolve)) (re) (no-windows !)
56 error fetching bundle: (.* not known|(\[Errno -?\d+] )?([Nn]o address associated with (host)?name|Temporary failure in name resolution|Name does not resolve)) (re) (no-windows !)
57 error fetching bundle: [Errno 1100*] getaddrinfo failed (glob) (windows !)
57 error fetching bundle: [Errno 1100*] getaddrinfo failed (glob) (windows !)
58 abort: error applying bundle
58 abort: error applying bundle
59 (if this error persists, consider contacting the server operator or disable clone bundles via "--config ui.clonebundles=false")
59 (if this error persists, consider contacting the server operator or disable clone bundles via "--config ui.clonebundles=false")
60 [255]
60 [255]
61
61
62 Server is not running aborts
62 Server is not running aborts
63
63
64 $ echo "http://localhost:$HGPORT1/bundle.hg" > server/.hg/clonebundles.manifest
64 $ echo "http://localhost:$HGPORT1/bundle.hg" > server/.hg/clonebundles.manifest
65 $ hg clone http://localhost:$HGPORT server-not-runner
65 $ hg clone http://localhost:$HGPORT server-not-runner
66 applying clone bundle from http://localhost:$HGPORT1/bundle.hg
66 applying clone bundle from http://localhost:$HGPORT1/bundle.hg
67 error fetching bundle: (.* refused.*|Protocol not supported|(.* )?\$EADDRNOTAVAIL\$|.* No route to host) (re)
67 error fetching bundle: (.* refused.*|Protocol not supported|(.* )?\$EADDRNOTAVAIL\$|.* No route to host) (re)
68 abort: error applying bundle
68 abort: error applying bundle
69 (if this error persists, consider contacting the server operator or disable clone bundles via "--config ui.clonebundles=false")
69 (if this error persists, consider contacting the server operator or disable clone bundles via "--config ui.clonebundles=false")
70 [255]
70 [255]
71
71
72 Server returns 404
72 Server returns 404
73
73
74 $ "$PYTHON" $TESTDIR/dumbhttp.py -p $HGPORT1 --pid http.pid
74 $ "$PYTHON" $TESTDIR/dumbhttp.py -p $HGPORT1 --pid http.pid
75 $ cat http.pid >> $DAEMON_PIDS
75 $ cat http.pid >> $DAEMON_PIDS
76 $ hg clone http://localhost:$HGPORT running-404
76 $ hg clone http://localhost:$HGPORT running-404
77 applying clone bundle from http://localhost:$HGPORT1/bundle.hg
77 applying clone bundle from http://localhost:$HGPORT1/bundle.hg
78 HTTP error fetching bundle: HTTP Error 404: File not found
78 HTTP error fetching bundle: HTTP Error 404: File not found
79 abort: error applying bundle
79 abort: error applying bundle
80 (if this error persists, consider contacting the server operator or disable clone bundles via "--config ui.clonebundles=false")
80 (if this error persists, consider contacting the server operator or disable clone bundles via "--config ui.clonebundles=false")
81 [255]
81 [255]
82
82
83 We can override failure to fall back to regular clone
83 We can override failure to fall back to regular clone
84
84
85 $ hg --config ui.clonebundlefallback=true clone -U http://localhost:$HGPORT 404-fallback
85 $ hg --config ui.clonebundlefallback=true clone -U http://localhost:$HGPORT 404-fallback
86 applying clone bundle from http://localhost:$HGPORT1/bundle.hg
86 applying clone bundle from http://localhost:$HGPORT1/bundle.hg
87 HTTP error fetching bundle: HTTP Error 404: File not found
87 HTTP error fetching bundle: HTTP Error 404: File not found
88 falling back to normal clone
88 falling back to normal clone
89 requesting all changes
89 requesting all changes
90 adding changesets
90 adding changesets
91 adding manifests
91 adding manifests
92 adding file changes
92 adding file changes
93 added 2 changesets with 2 changes to 2 files
93 added 2 changesets with 2 changes to 2 files
94 new changesets 53245c60e682:aaff8d2ffbbf
94 new changesets 53245c60e682:aaff8d2ffbbf
95
95
96 Bundle with partial content works
96 Bundle with partial content works
97
97
98 $ hg -R server bundle --type gzip-v1 --base null -r 53245c60e682 partial.hg
98 $ hg -R server bundle --type gzip-v1 --base null -r 53245c60e682 partial.hg
99 1 changesets found
99 1 changesets found
100
100
101 We verify exact bundle content as an extra check against accidental future
101 We verify exact bundle content as an extra check against accidental future
102 changes. If this output changes, we could break old clients.
102 changes. If this output changes, we could break old clients.
103
103
104 $ f --size --hexdump partial.hg
104 $ f --size --hexdump partial.hg
105 partial.hg: size=207
105 partial.hg: size=207
106 0000: 48 47 31 30 47 5a 78 9c 63 60 60 98 17 ac 12 93 |HG10GZx.c``.....|
106 0000: 48 47 31 30 47 5a 78 9c 63 60 60 98 17 ac 12 93 |HG10GZx.c``.....|
107 0010: f0 ac a9 23 45 70 cb bf 0d 5f 59 4e 4a 7f 79 21 |...#Ep..._YNJ.y!|
107 0010: f0 ac a9 23 45 70 cb bf 0d 5f 59 4e 4a 7f 79 21 |...#Ep..._YNJ.y!|
108 0020: 9b cc 40 24 20 a0 d7 ce 2c d1 38 25 cd 24 25 d5 |..@$ ...,.8%.$%.|
108 0020: 9b cc 40 24 20 a0 d7 ce 2c d1 38 25 cd 24 25 d5 |..@$ ...,.8%.$%.|
109 0030: d8 c2 22 cd 38 d9 24 cd 22 d5 c8 22 cd 24 cd 32 |..".8.$."..".$.2|
109 0030: d8 c2 22 cd 38 d9 24 cd 22 d5 c8 22 cd 24 cd 32 |..".8.$."..".$.2|
110 0040: d1 c2 d0 c4 c8 d2 32 d1 38 39 29 c9 34 cd d4 80 |......2.89).4...|
110 0040: d1 c2 d0 c4 c8 d2 32 d1 38 39 29 c9 34 cd d4 80 |......2.89).4...|
111 0050: ab 24 b5 b8 84 cb 40 c1 80 2b 2d 3f 9f 8b 2b 31 |.$....@..+-?..+1|
111 0050: ab 24 b5 b8 84 cb 40 c1 80 2b 2d 3f 9f 8b 2b 31 |.$....@..+-?..+1|
112 0060: 25 45 01 c8 80 9a d2 9b 65 fb e5 9e 45 bf 8d 7f |%E......e...E...|
112 0060: 25 45 01 c8 80 9a d2 9b 65 fb e5 9e 45 bf 8d 7f |%E......e...E...|
113 0070: 9f c6 97 9f 2b 44 34 67 d9 ec 8e 0f a0 92 0b 75 |....+D4g.......u|
113 0070: 9f c6 97 9f 2b 44 34 67 d9 ec 8e 0f a0 92 0b 75 |....+D4g.......u|
114 0080: 41 d6 24 59 18 a4 a4 9a a6 18 1a 5b 98 9b 5a 98 |A.$Y.......[..Z.|
114 0080: 41 d6 24 59 18 a4 a4 9a a6 18 1a 5b 98 9b 5a 98 |A.$Y.......[..Z.|
115 0090: 9a 18 26 9b a6 19 98 1a 99 99 26 a6 18 9a 98 24 |..&.......&....$|
115 0090: 9a 18 26 9b a6 19 98 1a 99 99 26 a6 18 9a 98 24 |..&.......&....$|
116 00a0: 26 59 a6 25 5a 98 a5 18 a6 24 71 41 35 b1 43 dc |&Y.%Z....$qA5.C.|
116 00a0: 26 59 a6 25 5a 98 a5 18 a6 24 71 41 35 b1 43 dc |&Y.%Z....$qA5.C.|
117 00b0: 16 b2 83 f7 e9 45 8b d2 56 c7 a3 1f 82 52 d7 8a |.....E..V....R..|
117 00b0: 16 b2 83 f7 e9 45 8b d2 56 c7 a3 1f 82 52 d7 8a |.....E..V....R..|
118 00c0: 78 ed fc d5 76 f1 36 35 dc 05 00 36 ed 5e c7 |x...v.65...6.^.|
118 00c0: 78 ed fc d5 76 f1 36 35 dc 05 00 36 ed 5e c7 |x...v.65...6.^.|
119
119
120 $ echo "http://localhost:$HGPORT1/partial.hg" > server/.hg/clonebundles.manifest
120 $ echo "http://localhost:$HGPORT1/partial.hg" > server/.hg/clonebundles.manifest
121 $ hg clone -U http://localhost:$HGPORT partial-bundle
121 $ hg clone -U http://localhost:$HGPORT partial-bundle
122 applying clone bundle from http://localhost:$HGPORT1/partial.hg
122 applying clone bundle from http://localhost:$HGPORT1/partial.hg
123 adding changesets
123 adding changesets
124 adding manifests
124 adding manifests
125 adding file changes
125 adding file changes
126 added 1 changesets with 1 changes to 1 files
126 added 1 changesets with 1 changes to 1 files
127 finished applying clone bundle
127 finished applying clone bundle
128 searching for changes
128 searching for changes
129 adding changesets
129 adding changesets
130 adding manifests
130 adding manifests
131 adding file changes
131 adding file changes
132 added 1 changesets with 1 changes to 1 files
132 added 1 changesets with 1 changes to 1 files
133 new changesets aaff8d2ffbbf
133 new changesets aaff8d2ffbbf
134 1 local changesets published
134 1 local changesets published
135
135
136 Incremental pull doesn't fetch bundle
136 Incremental pull doesn't fetch bundle
137
137
138 $ hg clone -r 53245c60e682 -U http://localhost:$HGPORT partial-clone
138 $ hg clone -r 53245c60e682 -U http://localhost:$HGPORT partial-clone
139 adding changesets
139 adding changesets
140 adding manifests
140 adding manifests
141 adding file changes
141 adding file changes
142 added 1 changesets with 1 changes to 1 files
142 added 1 changesets with 1 changes to 1 files
143 new changesets 53245c60e682
143 new changesets 53245c60e682
144
144
145 $ cd partial-clone
145 $ cd partial-clone
146 $ hg pull
146 $ hg pull
147 pulling from http://localhost:$HGPORT/
147 pulling from http://localhost:$HGPORT/
148 searching for changes
148 searching for changes
149 adding changesets
149 adding changesets
150 adding manifests
150 adding manifests
151 adding file changes
151 adding file changes
152 added 1 changesets with 1 changes to 1 files
152 added 1 changesets with 1 changes to 1 files
153 new changesets aaff8d2ffbbf
153 new changesets aaff8d2ffbbf
154 (run 'hg update' to get a working copy)
154 (run 'hg update' to get a working copy)
155 $ cd ..
155 $ cd ..
156
156
157 Bundle with full content works
157 Bundle with full content works
158
158
159 $ hg -R server bundle --type gzip-v2 --base null -r tip full.hg
159 $ hg -R server bundle --type gzip-v2 --base null -r tip full.hg
160 2 changesets found
160 2 changesets found
161
161
162 Again, we perform an extra check against bundle content changes. If this content
162 Again, we perform an extra check against bundle content changes. If this content
163 changes, clone bundles produced by new Mercurial versions may not be readable
163 changes, clone bundles produced by new Mercurial versions may not be readable
164 by old clients.
164 by old clients.
165
165
166 $ f --size --hexdump full.hg
166 $ f --size --hexdump full.hg
167 full.hg: size=442
167 full.hg: size=442
168 0000: 48 47 32 30 00 00 00 0e 43 6f 6d 70 72 65 73 73 |HG20....Compress|
168 0000: 48 47 32 30 00 00 00 0e 43 6f 6d 70 72 65 73 73 |HG20....Compress|
169 0010: 69 6f 6e 3d 47 5a 78 9c 63 60 60 d0 e4 76 f6 70 |ion=GZx.c``..v.p|
169 0010: 69 6f 6e 3d 47 5a 78 9c 63 60 60 d0 e4 76 f6 70 |ion=GZx.c``..v.p|
170 0020: f4 73 77 75 0f f2 0f 0d 60 00 02 46 46 76 26 4e |.swu....`..FFv&N|
170 0020: f4 73 77 75 0f f2 0f 0d 60 00 02 46 46 76 26 4e |.swu....`..FFv&N|
171 0030: c6 b2 d4 a2 e2 cc fc 3c 03 a3 bc a4 e4 8c c4 bc |.......<........|
171 0030: c6 b2 d4 a2 e2 cc fc 3c 03 a3 bc a4 e4 8c c4 bc |.......<........|
172 0040: f4 d4 62 23 06 06 e6 19 40 f9 4d c1 2a 31 09 cf |..b#....@.M.*1..|
172 0040: f4 d4 62 23 06 06 e6 19 40 f9 4d c1 2a 31 09 cf |..b#....@.M.*1..|
173 0050: 9a 3a 52 04 b7 fc db f0 95 e5 a4 f4 97 17 b2 c9 |.:R.............|
173 0050: 9a 3a 52 04 b7 fc db f0 95 e5 a4 f4 97 17 b2 c9 |.:R.............|
174 0060: 0c 14 00 02 e6 d9 99 25 1a a7 a4 99 a4 a4 1a 5b |.......%.......[|
174 0060: 0c 14 00 02 e6 d9 99 25 1a a7 a4 99 a4 a4 1a 5b |.......%.......[|
175 0070: 58 a4 19 27 9b a4 59 a4 1a 59 a4 99 a4 59 26 5a |X..'..Y..Y...Y&Z|
175 0070: 58 a4 19 27 9b a4 59 a4 1a 59 a4 99 a4 59 26 5a |X..'..Y..Y...Y&Z|
176 0080: 18 9a 18 59 5a 26 1a 27 27 25 99 a6 99 1a 70 95 |...YZ&.''%....p.|
176 0080: 18 9a 18 59 5a 26 1a 27 27 25 99 a6 99 1a 70 95 |...YZ&.''%....p.|
177 0090: a4 16 97 70 19 28 18 70 a5 e5 e7 73 71 25 a6 a4 |...p.(.p...sq%..|
177 0090: a4 16 97 70 19 28 18 70 a5 e5 e7 73 71 25 a6 a4 |...p.(.p...sq%..|
178 00a0: 28 00 19 20 17 af fa df ab ff 7b 3f fb 92 dc 8b |(.. ......{?....|
178 00a0: 28 00 19 20 17 af fa df ab ff 7b 3f fb 92 dc 8b |(.. ......{?....|
179 00b0: 1f 62 bb 9e b7 d7 d9 87 3d 5a 44 89 2f b0 99 87 |.b......=ZD./...|
179 00b0: 1f 62 bb 9e b7 d7 d9 87 3d 5a 44 89 2f b0 99 87 |.b......=ZD./...|
180 00c0: ec e2 54 63 43 e3 b4 64 43 73 23 33 43 53 0b 63 |..TcC..dCs#3CS.c|
180 00c0: ec e2 54 63 43 e3 b4 64 43 73 23 33 43 53 0b 63 |..TcC..dCs#3CS.c|
181 00d0: d3 14 23 03 a0 fb 2c 2c 0c d3 80 1e 30 49 49 b1 |..#...,,....0II.|
181 00d0: d3 14 23 03 a0 fb 2c 2c 0c d3 80 1e 30 49 49 b1 |..#...,,....0II.|
182 00e0: 4c 4a 32 48 33 30 b0 34 42 b8 38 29 b1 08 e2 62 |LJ2H30.4B.8)...b|
182 00e0: 4c 4a 32 48 33 30 b0 34 42 b8 38 29 b1 08 e2 62 |LJ2H30.4B.8)...b|
183 00f0: 20 03 6a ca c2 2c db 2f f7 2c fa 6d fc fb 34 be | .j..,./.,.m..4.|
183 00f0: 20 03 6a ca c2 2c db 2f f7 2c fa 6d fc fb 34 be | .j..,./.,.m..4.|
184 0100: fc 5c 21 a2 39 cb 66 77 7c 00 0d c3 59 17 14 58 |.\!.9.fw|...Y..X|
184 0100: fc 5c 21 a2 39 cb 66 77 7c 00 0d c3 59 17 14 58 |.\!.9.fw|...Y..X|
185 0110: 49 16 06 29 a9 a6 29 86 c6 16 e6 a6 16 a6 26 86 |I..)..).......&.|
185 0110: 49 16 06 29 a9 a6 29 86 c6 16 e6 a6 16 a6 26 86 |I..)..).......&.|
186 0120: c9 a6 69 06 a6 46 66 a6 89 29 86 26 26 89 49 96 |..i..Ff..).&&.I.|
186 0120: c9 a6 69 06 a6 46 66 a6 89 29 86 26 26 89 49 96 |..i..Ff..).&&.I.|
187 0130: 69 89 16 66 29 86 29 49 5c 20 07 3e 16 fe 23 ae |i..f).)I\ .>..#.|
187 0130: 69 89 16 66 29 86 29 49 5c 20 07 3e 16 fe 23 ae |i..f).)I\ .>..#.|
188 0140: 26 da 1c ab 10 1f d1 f8 e3 b3 ef cd dd fc 0c 93 |&...............|
188 0140: 26 da 1c ab 10 1f d1 f8 e3 b3 ef cd dd fc 0c 93 |&...............|
189 0150: 88 75 34 36 75 04 82 55 17 14 36 a4 38 10 04 d8 |.u46u..U..6.8...|
189 0150: 88 75 34 36 75 04 82 55 17 14 36 a4 38 10 04 d8 |.u46u..U..6.8...|
190 0160: 21 01 9a b1 83 f7 e9 45 8b d2 56 c7 a3 1f 82 52 |!......E..V....R|
190 0160: 21 01 9a b1 83 f7 e9 45 8b d2 56 c7 a3 1f 82 52 |!......E..V....R|
191 0170: d7 8a 78 ed fc d5 76 f1 36 25 81 89 c7 ad ec 90 |..x...v.6%......|
191 0170: d7 8a 78 ed fc d5 76 f1 36 25 81 89 c7 ad ec 90 |..x...v.6%......|
192 0180: 54 47 75 2b 89 48 b1 b2 62 c9 89 c9 19 a9 56 45 |TGu+.H..b.....VE|
192 0180: 54 47 75 2b 89 48 b1 b2 62 c9 89 c9 19 a9 56 45 |TGu+.H..b.....VE|
193 0190: a9 65 ba 49 45 89 79 c9 19 ba 60 01 a0 14 23 58 |.e.IE.y...`...#X|
193 0190: a9 65 ba 49 45 89 79 c9 19 ba 60 01 a0 14 23 58 |.e.IE.y...`...#X|
194 01a0: 81 35 c8 7d 40 cc 04 e2 a4 a4 a6 25 96 e6 94 60 |.5.}@......%...`|
194 01a0: 81 35 c8 7d 40 cc 04 e2 a4 a4 a6 25 96 e6 94 60 |.5.}@......%...`|
195 01b0: 33 17 5f 54 00 00 d3 1b 0d 4c |3._T.....L|
195 01b0: 33 17 5f 54 00 00 d3 1b 0d 4c |3._T.....L|
196
196
197 $ echo "http://localhost:$HGPORT1/full.hg" > server/.hg/clonebundles.manifest
197 $ echo "http://localhost:$HGPORT1/full.hg" > server/.hg/clonebundles.manifest
198 $ hg clone -U http://localhost:$HGPORT full-bundle
198 $ hg clone -U http://localhost:$HGPORT full-bundle
199 applying clone bundle from http://localhost:$HGPORT1/full.hg
199 applying clone bundle from http://localhost:$HGPORT1/full.hg
200 adding changesets
200 adding changesets
201 adding manifests
201 adding manifests
202 adding file changes
202 adding file changes
203 added 2 changesets with 2 changes to 2 files
203 added 2 changesets with 2 changes to 2 files
204 finished applying clone bundle
204 finished applying clone bundle
205 searching for changes
205 searching for changes
206 no changes found
206 no changes found
207 2 local changesets published
207 2 local changesets published
208
208
209 Feature works over SSH
209 Feature works over SSH
210
210
211 $ hg clone -U ssh://user@dummy/server ssh-full-clone
211 $ hg clone -U ssh://user@dummy/server ssh-full-clone
212 applying clone bundle from http://localhost:$HGPORT1/full.hg
212 applying clone bundle from http://localhost:$HGPORT1/full.hg
213 adding changesets
213 adding changesets
214 adding manifests
214 adding manifests
215 adding file changes
215 adding file changes
216 added 2 changesets with 2 changes to 2 files
216 added 2 changesets with 2 changes to 2 files
217 finished applying clone bundle
217 finished applying clone bundle
218 searching for changes
218 searching for changes
219 no changes found
219 no changes found
220 2 local changesets published
220 2 local changesets published
221
221
222 Entry with unknown BUNDLESPEC is filtered and not used
222 Entry with unknown BUNDLESPEC is filtered and not used
223
223
224 $ cat > server/.hg/clonebundles.manifest << EOF
224 $ cat > server/.hg/clonebundles.manifest << EOF
225 > http://bad.entry1 BUNDLESPEC=UNKNOWN
225 > http://bad.entry1 BUNDLESPEC=UNKNOWN
226 > http://bad.entry2 BUNDLESPEC=xz-v1
226 > http://bad.entry2 BUNDLESPEC=xz-v1
227 > http://bad.entry3 BUNDLESPEC=none-v100
227 > http://bad.entry3 BUNDLESPEC=none-v100
228 > http://localhost:$HGPORT1/full.hg BUNDLESPEC=gzip-v2
228 > http://localhost:$HGPORT1/full.hg BUNDLESPEC=gzip-v2
229 > EOF
229 > EOF
230
230
231 $ hg clone -U http://localhost:$HGPORT filter-unknown-type
231 $ hg clone -U http://localhost:$HGPORT filter-unknown-type
232 applying clone bundle from http://localhost:$HGPORT1/full.hg
232 applying clone bundle from http://localhost:$HGPORT1/full.hg
233 adding changesets
233 adding changesets
234 adding manifests
234 adding manifests
235 adding file changes
235 adding file changes
236 added 2 changesets with 2 changes to 2 files
236 added 2 changesets with 2 changes to 2 files
237 finished applying clone bundle
237 finished applying clone bundle
238 searching for changes
238 searching for changes
239 no changes found
239 no changes found
240 2 local changesets published
240 2 local changesets published
241
241
242 Automatic fallback when all entries are filtered
242 Automatic fallback when all entries are filtered
243
243
244 $ cat > server/.hg/clonebundles.manifest << EOF
244 $ cat > server/.hg/clonebundles.manifest << EOF
245 > http://bad.entry BUNDLESPEC=UNKNOWN
245 > http://bad.entry BUNDLESPEC=UNKNOWN
246 > EOF
246 > EOF
247
247
248 $ hg clone -U http://localhost:$HGPORT filter-all
248 $ hg clone -U http://localhost:$HGPORT filter-all
249 no compatible clone bundles available on server; falling back to regular clone
249 no compatible clone bundles available on server; falling back to regular clone
250 (you may want to report this to the server operator)
250 (you may want to report this to the server operator)
251 requesting all changes
251 requesting all changes
252 adding changesets
252 adding changesets
253 adding manifests
253 adding manifests
254 adding file changes
254 adding file changes
255 added 2 changesets with 2 changes to 2 files
255 added 2 changesets with 2 changes to 2 files
256 new changesets 53245c60e682:aaff8d2ffbbf
256 new changesets 53245c60e682:aaff8d2ffbbf
257
257
258 We require a Python version that supports SNI. Therefore, URLs requiring SNI
258 We require a Python version that supports SNI. Therefore, URLs requiring SNI
259 are not filtered.
259 are not filtered.
260
260
261 $ cp full.hg sni.hg
261 $ cp full.hg sni.hg
262 $ cat > server/.hg/clonebundles.manifest << EOF
262 $ cat > server/.hg/clonebundles.manifest << EOF
263 > http://localhost:$HGPORT1/sni.hg REQUIRESNI=true
263 > http://localhost:$HGPORT1/sni.hg REQUIRESNI=true
264 > http://localhost:$HGPORT1/full.hg
264 > http://localhost:$HGPORT1/full.hg
265 > EOF
265 > EOF
266
266
267 $ hg clone -U http://localhost:$HGPORT sni-supported
267 $ hg clone -U http://localhost:$HGPORT sni-supported
268 applying clone bundle from http://localhost:$HGPORT1/sni.hg
268 applying clone bundle from http://localhost:$HGPORT1/sni.hg
269 adding changesets
269 adding changesets
270 adding manifests
270 adding manifests
271 adding file changes
271 adding file changes
272 added 2 changesets with 2 changes to 2 files
272 added 2 changesets with 2 changes to 2 files
273 finished applying clone bundle
273 finished applying clone bundle
274 searching for changes
274 searching for changes
275 no changes found
275 no changes found
276 2 local changesets published
276 2 local changesets published
277
277
278 Stream clone bundles are supported
278 Stream clone bundles are supported
279
279
280 $ hg -R server debugcreatestreamclonebundle packed.hg
280 $ hg -R server debugcreatestreamclonebundle packed.hg
281 writing 613 bytes for 4 files
281 writing 613 bytes for 4 files
282 bundle requirements: generaldelta, revlogv1, sparserevlog (no-rust no-zstd !)
282 bundle requirements: generaldelta, revlogv1, sparserevlog (no-rust no-zstd !)
283 bundle requirements: generaldelta, revlog-compression-zstd, revlogv1, sparserevlog (no-rust zstd !)
283 bundle requirements: generaldelta, revlog-compression-zstd, revlogv1, sparserevlog (no-rust zstd !)
284 bundle requirements: generaldelta, revlog-compression-zstd, revlogv1, sparserevlog (rust !)
284 bundle requirements: generaldelta, revlog-compression-zstd, revlogv1, sparserevlog (rust !)
285
285
286 No bundle spec should work
286 No bundle spec should work
287
287
288 $ cat > server/.hg/clonebundles.manifest << EOF
288 $ cat > server/.hg/clonebundles.manifest << EOF
289 > http://localhost:$HGPORT1/packed.hg
289 > http://localhost:$HGPORT1/packed.hg
290 > EOF
290 > EOF
291
291
292 $ hg clone -U http://localhost:$HGPORT stream-clone-no-spec
292 $ hg clone -U http://localhost:$HGPORT stream-clone-no-spec
293 applying clone bundle from http://localhost:$HGPORT1/packed.hg
293 applying clone bundle from http://localhost:$HGPORT1/packed.hg
294 4 files to transfer, 613 bytes of data
294 4 files to transfer, 613 bytes of data
295 transferred 613 bytes in *.* seconds (*) (glob)
295 transferred 613 bytes in *.* seconds (*) (glob)
296 finished applying clone bundle
296 finished applying clone bundle
297 searching for changes
297 searching for changes
298 no changes found
298 no changes found
299
299
300 Bundle spec without parameters should work
300 Bundle spec without parameters should work
301
301
302 $ cat > server/.hg/clonebundles.manifest << EOF
302 $ cat > server/.hg/clonebundles.manifest << EOF
303 > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1
303 > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1
304 > EOF
304 > EOF
305
305
306 $ hg clone -U http://localhost:$HGPORT stream-clone-vanilla-spec
306 $ hg clone -U http://localhost:$HGPORT stream-clone-vanilla-spec
307 applying clone bundle from http://localhost:$HGPORT1/packed.hg
307 applying clone bundle from http://localhost:$HGPORT1/packed.hg
308 4 files to transfer, 613 bytes of data
308 4 files to transfer, 613 bytes of data
309 transferred 613 bytes in *.* seconds (*) (glob)
309 transferred 613 bytes in *.* seconds (*) (glob)
310 finished applying clone bundle
310 finished applying clone bundle
311 searching for changes
311 searching for changes
312 no changes found
312 no changes found
313
313
314 Bundle spec with format requirements should work
314 Bundle spec with format requirements should work
315
315
316 $ cat > server/.hg/clonebundles.manifest << EOF
316 $ cat > server/.hg/clonebundles.manifest << EOF
317 > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1;requirements%3Drevlogv1
317 > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1;requirements%3Drevlogv1
318 > EOF
318 > EOF
319
319
320 $ hg clone -U http://localhost:$HGPORT stream-clone-supported-requirements
320 $ hg clone -U http://localhost:$HGPORT stream-clone-supported-requirements
321 applying clone bundle from http://localhost:$HGPORT1/packed.hg
321 applying clone bundle from http://localhost:$HGPORT1/packed.hg
322 4 files to transfer, 613 bytes of data
322 4 files to transfer, 613 bytes of data
323 transferred 613 bytes in *.* seconds (*) (glob)
323 transferred 613 bytes in *.* seconds (*) (glob)
324 finished applying clone bundle
324 finished applying clone bundle
325 searching for changes
325 searching for changes
326 no changes found
326 no changes found
327
327
328 Stream bundle spec with unknown requirements should be filtered out
328 Stream bundle spec with unknown requirements should be filtered out
329
329
330 $ cat > server/.hg/clonebundles.manifest << EOF
330 $ cat > server/.hg/clonebundles.manifest << EOF
331 > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1;requirements%3Drevlogv42
331 > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1;requirements%3Drevlogv42
332 > EOF
332 > EOF
333
333
334 $ hg clone -U http://localhost:$HGPORT stream-clone-unsupported-requirements
334 $ hg clone -U http://localhost:$HGPORT stream-clone-unsupported-requirements
335 no compatible clone bundles available on server; falling back to regular clone
335 no compatible clone bundles available on server; falling back to regular clone
336 (you may want to report this to the server operator)
336 (you may want to report this to the server operator)
337 requesting all changes
337 requesting all changes
338 adding changesets
338 adding changesets
339 adding manifests
339 adding manifests
340 adding file changes
340 adding file changes
341 added 2 changesets with 2 changes to 2 files
341 added 2 changesets with 2 changes to 2 files
342 new changesets 53245c60e682:aaff8d2ffbbf
342 new changesets 53245c60e682:aaff8d2ffbbf
343
343
344 Set up manifest for testing preferences
344 Set up manifest for testing preferences
345 (Remember, the TYPE does not have to match reality - the URL is
345 (Remember, the TYPE does not have to match reality - the URL is
346 important)
346 important)
347
347
348 $ cp full.hg gz-a.hg
348 $ cp full.hg gz-a.hg
349 $ cp full.hg gz-b.hg
349 $ cp full.hg gz-b.hg
350 $ cp full.hg bz2-a.hg
350 $ cp full.hg bz2-a.hg
351 $ cp full.hg bz2-b.hg
351 $ cp full.hg bz2-b.hg
352 $ cat > server/.hg/clonebundles.manifest << EOF
352 $ cat > server/.hg/clonebundles.manifest << EOF
353 > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2 extra=a
353 > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2 extra=a
354 > http://localhost:$HGPORT1/bz2-a.hg BUNDLESPEC=bzip2-v2 extra=a
354 > http://localhost:$HGPORT1/bz2-a.hg BUNDLESPEC=bzip2-v2 extra=a
355 > http://localhost:$HGPORT1/gz-b.hg BUNDLESPEC=gzip-v2 extra=b
355 > http://localhost:$HGPORT1/gz-b.hg BUNDLESPEC=gzip-v2 extra=b
356 > http://localhost:$HGPORT1/bz2-b.hg BUNDLESPEC=bzip2-v2 extra=b
356 > http://localhost:$HGPORT1/bz2-b.hg BUNDLESPEC=bzip2-v2 extra=b
357 > EOF
357 > EOF
358
358
359 Preferring an undefined attribute will take first entry
359 Preferring an undefined attribute will take first entry
360
360
361 $ hg --config ui.clonebundleprefers=foo=bar clone -U http://localhost:$HGPORT prefer-foo
361 $ hg --config ui.clonebundleprefers=foo=bar clone -U http://localhost:$HGPORT prefer-foo
362 applying clone bundle from http://localhost:$HGPORT1/gz-a.hg
362 applying clone bundle from http://localhost:$HGPORT1/gz-a.hg
363 adding changesets
363 adding changesets
364 adding manifests
364 adding manifests
365 adding file changes
365 adding file changes
366 added 2 changesets with 2 changes to 2 files
366 added 2 changesets with 2 changes to 2 files
367 finished applying clone bundle
367 finished applying clone bundle
368 searching for changes
368 searching for changes
369 no changes found
369 no changes found
370 2 local changesets published
370 2 local changesets published
371
371
372 Preferring bz2 type will download first entry of that type
372 Preferring bz2 type will download first entry of that type
373
373
374 $ hg --config ui.clonebundleprefers=COMPRESSION=bzip2 clone -U http://localhost:$HGPORT prefer-bz
374 $ hg --config ui.clonebundleprefers=COMPRESSION=bzip2 clone -U http://localhost:$HGPORT prefer-bz
375 applying clone bundle from http://localhost:$HGPORT1/bz2-a.hg
375 applying clone bundle from http://localhost:$HGPORT1/bz2-a.hg
376 adding changesets
376 adding changesets
377 adding manifests
377 adding manifests
378 adding file changes
378 adding file changes
379 added 2 changesets with 2 changes to 2 files
379 added 2 changesets with 2 changes to 2 files
380 finished applying clone bundle
380 finished applying clone bundle
381 searching for changes
381 searching for changes
382 no changes found
382 no changes found
383 2 local changesets published
383 2 local changesets published
384
384
385 Preferring multiple values of an option works
385 Preferring multiple values of an option works
386
386
387 $ hg --config ui.clonebundleprefers=COMPRESSION=unknown,COMPRESSION=bzip2 clone -U http://localhost:$HGPORT prefer-multiple-bz
387 $ hg --config ui.clonebundleprefers=COMPRESSION=unknown,COMPRESSION=bzip2 clone -U http://localhost:$HGPORT prefer-multiple-bz
388 applying clone bundle from http://localhost:$HGPORT1/bz2-a.hg
388 applying clone bundle from http://localhost:$HGPORT1/bz2-a.hg
389 adding changesets
389 adding changesets
390 adding manifests
390 adding manifests
391 adding file changes
391 adding file changes
392 added 2 changesets with 2 changes to 2 files
392 added 2 changesets with 2 changes to 2 files
393 finished applying clone bundle
393 finished applying clone bundle
394 searching for changes
394 searching for changes
395 no changes found
395 no changes found
396 2 local changesets published
396 2 local changesets published
397
397
398 Sorting multiple values should get us back to original first entry
398 Sorting multiple values should get us back to original first entry
399
399
400 $ hg --config ui.clonebundleprefers=BUNDLESPEC=unknown,BUNDLESPEC=gzip-v2,BUNDLESPEC=bzip2-v2 clone -U http://localhost:$HGPORT prefer-multiple-gz
400 $ hg --config ui.clonebundleprefers=BUNDLESPEC=unknown,BUNDLESPEC=gzip-v2,BUNDLESPEC=bzip2-v2 clone -U http://localhost:$HGPORT prefer-multiple-gz
401 applying clone bundle from http://localhost:$HGPORT1/gz-a.hg
401 applying clone bundle from http://localhost:$HGPORT1/gz-a.hg
402 adding changesets
402 adding changesets
403 adding manifests
403 adding manifests
404 adding file changes
404 adding file changes
405 added 2 changesets with 2 changes to 2 files
405 added 2 changesets with 2 changes to 2 files
406 finished applying clone bundle
406 finished applying clone bundle
407 searching for changes
407 searching for changes
408 no changes found
408 no changes found
409 2 local changesets published
409 2 local changesets published
410
410
411 Preferring multiple attributes has correct order
411 Preferring multiple attributes has correct order
412
412
413 $ hg --config ui.clonebundleprefers=extra=b,BUNDLESPEC=bzip2-v2 clone -U http://localhost:$HGPORT prefer-separate-attributes
413 $ hg --config ui.clonebundleprefers=extra=b,BUNDLESPEC=bzip2-v2 clone -U http://localhost:$HGPORT prefer-separate-attributes
414 applying clone bundle from http://localhost:$HGPORT1/bz2-b.hg
414 applying clone bundle from http://localhost:$HGPORT1/bz2-b.hg
415 adding changesets
415 adding changesets
416 adding manifests
416 adding manifests
417 adding file changes
417 adding file changes
418 added 2 changesets with 2 changes to 2 files
418 added 2 changesets with 2 changes to 2 files
419 finished applying clone bundle
419 finished applying clone bundle
420 searching for changes
420 searching for changes
421 no changes found
421 no changes found
422 2 local changesets published
422 2 local changesets published
423
423
424 Test where attribute is missing from some entries
424 Test where attribute is missing from some entries
425
425
426 $ cat > server/.hg/clonebundles.manifest << EOF
426 $ cat > server/.hg/clonebundles.manifest << EOF
427 > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2
427 > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2
428 > http://localhost:$HGPORT1/bz2-a.hg BUNDLESPEC=bzip2-v2
428 > http://localhost:$HGPORT1/bz2-a.hg BUNDLESPEC=bzip2-v2
429 > http://localhost:$HGPORT1/gz-b.hg BUNDLESPEC=gzip-v2 extra=b
429 > http://localhost:$HGPORT1/gz-b.hg BUNDLESPEC=gzip-v2 extra=b
430 > http://localhost:$HGPORT1/bz2-b.hg BUNDLESPEC=bzip2-v2 extra=b
430 > http://localhost:$HGPORT1/bz2-b.hg BUNDLESPEC=bzip2-v2 extra=b
431 > EOF
431 > EOF
432
432
433 $ hg --config ui.clonebundleprefers=extra=b clone -U http://localhost:$HGPORT prefer-partially-defined-attribute
433 $ hg --config ui.clonebundleprefers=extra=b clone -U http://localhost:$HGPORT prefer-partially-defined-attribute
434 applying clone bundle from http://localhost:$HGPORT1/gz-b.hg
434 applying clone bundle from http://localhost:$HGPORT1/gz-b.hg
435 adding changesets
435 adding changesets
436 adding manifests
436 adding manifests
437 adding file changes
437 adding file changes
438 added 2 changesets with 2 changes to 2 files
438 added 2 changesets with 2 changes to 2 files
439 finished applying clone bundle
439 finished applying clone bundle
440 searching for changes
440 searching for changes
441 no changes found
441 no changes found
442 2 local changesets published
442 2 local changesets published
443
443
444 Test a bad attribute list
444 Test a bad attribute list
445
445
446 $ hg --config ui.clonebundleprefers=bad clone -U http://localhost:$HGPORT bad-input
446 $ hg --config ui.clonebundleprefers=bad clone -U http://localhost:$HGPORT bad-input
447 abort: invalid ui.clonebundleprefers item: bad
447 abort: invalid ui.clonebundleprefers item: bad
448 (each comma separated item should be key=value pairs)
448 (each comma separated item should be key=value pairs)
449 [255]
449 [255]
450 $ hg --config ui.clonebundleprefers=key=val,bad,key2=val2 clone \
450 $ hg --config ui.clonebundleprefers=key=val,bad,key2=val2 clone \
451 > -U http://localhost:$HGPORT bad-input
451 > -U http://localhost:$HGPORT bad-input
452 abort: invalid ui.clonebundleprefers item: bad
452 abort: invalid ui.clonebundleprefers item: bad
453 (each comma separated item should be key=value pairs)
453 (each comma separated item should be key=value pairs)
454 [255]
454 [255]
455
455
456
456
457 Test interaction between clone bundles and --stream
457 Test interaction between clone bundles and --stream
458
458
459 A manifest with just a gzip bundle
459 A manifest with just a gzip bundle
460
460
461 $ cat > server/.hg/clonebundles.manifest << EOF
461 $ cat > server/.hg/clonebundles.manifest << EOF
462 > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2
462 > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2
463 > EOF
463 > EOF
464
464
465 $ hg clone -U --stream http://localhost:$HGPORT uncompressed-gzip
465 $ hg clone -U --stream http://localhost:$HGPORT uncompressed-gzip
466 no compatible clone bundles available on server; falling back to regular clone
466 no compatible clone bundles available on server; falling back to regular clone
467 (you may want to report this to the server operator)
467 (you may want to report this to the server operator)
468 streaming all changes
468 streaming all changes
469 9 files to transfer, 816 bytes of data
469 9 files to transfer, 816 bytes of data
470 transferred 816 bytes in * seconds (*) (glob)
470 transferred 816 bytes in * seconds (*) (glob)
471
471
472 A manifest with a stream clone but no BUNDLESPEC
472 A manifest with a stream clone but no BUNDLESPEC
473
473
474 $ cat > server/.hg/clonebundles.manifest << EOF
474 $ cat > server/.hg/clonebundles.manifest << EOF
475 > http://localhost:$HGPORT1/packed.hg
475 > http://localhost:$HGPORT1/packed.hg
476 > EOF
476 > EOF
477
477
478 $ hg clone -U --stream http://localhost:$HGPORT uncompressed-no-bundlespec
478 $ hg clone -U --stream http://localhost:$HGPORT uncompressed-no-bundlespec
479 no compatible clone bundles available on server; falling back to regular clone
479 no compatible clone bundles available on server; falling back to regular clone
480 (you may want to report this to the server operator)
480 (you may want to report this to the server operator)
481 streaming all changes
481 streaming all changes
482 9 files to transfer, 816 bytes of data
482 9 files to transfer, 816 bytes of data
483 transferred 816 bytes in * seconds (*) (glob)
483 transferred 816 bytes in * seconds (*) (glob)
484
484
485 A manifest with a gzip bundle and a stream clone
485 A manifest with a gzip bundle and a stream clone
486
486
487 $ cat > server/.hg/clonebundles.manifest << EOF
487 $ cat > server/.hg/clonebundles.manifest << EOF
488 > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2
488 > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2
489 > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1
489 > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1
490 > EOF
490 > EOF
491
491
492 $ hg clone -U --stream http://localhost:$HGPORT uncompressed-gzip-packed
492 $ hg clone -U --stream http://localhost:$HGPORT uncompressed-gzip-packed
493 applying clone bundle from http://localhost:$HGPORT1/packed.hg
493 applying clone bundle from http://localhost:$HGPORT1/packed.hg
494 4 files to transfer, 613 bytes of data
494 4 files to transfer, 613 bytes of data
495 transferred 613 bytes in * seconds (*) (glob)
495 transferred 613 bytes in * seconds (*) (glob)
496 finished applying clone bundle
496 finished applying clone bundle
497 searching for changes
497 searching for changes
498 no changes found
498 no changes found
499
499
500 A manifest with a gzip bundle and stream clone with supported requirements
500 A manifest with a gzip bundle and stream clone with supported requirements
501
501
502 $ cat > server/.hg/clonebundles.manifest << EOF
502 $ cat > server/.hg/clonebundles.manifest << EOF
503 > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2
503 > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2
504 > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1;requirements%3Drevlogv1
504 > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1;requirements%3Drevlogv1
505 > EOF
505 > EOF
506
506
507 $ hg clone -U --stream http://localhost:$HGPORT uncompressed-gzip-packed-requirements
507 $ hg clone -U --stream http://localhost:$HGPORT uncompressed-gzip-packed-requirements
508 applying clone bundle from http://localhost:$HGPORT1/packed.hg
508 applying clone bundle from http://localhost:$HGPORT1/packed.hg
509 4 files to transfer, 613 bytes of data
509 4 files to transfer, 613 bytes of data
510 transferred 613 bytes in * seconds (*) (glob)
510 transferred 613 bytes in * seconds (*) (glob)
511 finished applying clone bundle
511 finished applying clone bundle
512 searching for changes
512 searching for changes
513 no changes found
513 no changes found
514
514
515 A manifest with a gzip bundle and a stream clone with unsupported requirements
515 A manifest with a gzip bundle and a stream clone with unsupported requirements
516
516
517 $ cat > server/.hg/clonebundles.manifest << EOF
517 $ cat > server/.hg/clonebundles.manifest << EOF
518 > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2
518 > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2
519 > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1;requirements%3Drevlogv42
519 > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1;requirements%3Drevlogv42
520 > EOF
520 > EOF
521
521
522 $ hg clone -U --stream http://localhost:$HGPORT uncompressed-gzip-packed-unsupported-requirements
522 $ hg clone -U --stream http://localhost:$HGPORT uncompressed-gzip-packed-unsupported-requirements
523 no compatible clone bundles available on server; falling back to regular clone
523 no compatible clone bundles available on server; falling back to regular clone
524 (you may want to report this to the server operator)
524 (you may want to report this to the server operator)
525 streaming all changes
525 streaming all changes
526 9 files to transfer, 816 bytes of data
526 9 files to transfer, 816 bytes of data
527 transferred 816 bytes in * seconds (*) (glob)
527 transferred 816 bytes in * seconds (*) (glob)
528
528
529 Test clone bundle retrieved through bundle2
529 Test clone bundle retrieved through bundle2
530
530
531 $ cat << EOF >> $HGRCPATH
531 $ cat << EOF >> $HGRCPATH
532 > [extensions]
532 > [extensions]
533 > largefiles=
533 > largefiles=
534 > EOF
534 > EOF
535 $ killdaemons.py
535 $ killdaemons.py
536 $ hg -R server serve -d -p $HGPORT --pid-file hg.pid --accesslog access.log
536 $ hg -R server serve -d -p $HGPORT --pid-file hg.pid --accesslog access.log
537 $ cat hg.pid >> $DAEMON_PIDS
537 $ cat hg.pid >> $DAEMON_PIDS
538
538
539 $ hg -R server debuglfput gz-a.hg
539 $ hg -R server debuglfput gz-a.hg
540 1f74b3d08286b9b3a16fb3fa185dd29219cbc6ae
540 1f74b3d08286b9b3a16fb3fa185dd29219cbc6ae
541
541
542 $ cat > server/.hg/clonebundles.manifest << EOF
542 $ cat > server/.hg/clonebundles.manifest << EOF
543 > largefile://1f74b3d08286b9b3a16fb3fa185dd29219cbc6ae BUNDLESPEC=gzip-v2
543 > largefile://1f74b3d08286b9b3a16fb3fa185dd29219cbc6ae BUNDLESPEC=gzip-v2
544 > EOF
544 > EOF
545
545
546 $ hg clone -U http://localhost:$HGPORT largefile-provided --traceback
546 $ hg clone -U http://localhost:$HGPORT largefile-provided --traceback
547 applying clone bundle from largefile://1f74b3d08286b9b3a16fb3fa185dd29219cbc6ae
547 applying clone bundle from largefile://1f74b3d08286b9b3a16fb3fa185dd29219cbc6ae
548 adding changesets
548 adding changesets
549 adding manifests
549 adding manifests
550 adding file changes
550 adding file changes
551 added 2 changesets with 2 changes to 2 files
551 added 2 changesets with 2 changes to 2 files
552 finished applying clone bundle
552 finished applying clone bundle
553 searching for changes
553 searching for changes
554 no changes found
554 no changes found
555 2 local changesets published
555 2 local changesets published
556 $ killdaemons.py
556 $ killdaemons.py
557
557
558 A manifest with a gzip bundle requiring too much memory for a 16MB system and working
558 A manifest with a gzip bundle requiring too much memory for a 16MB system and working
559 on a 32MB system.
559 on a 32MB system.
560
560
561 $ "$PYTHON" $TESTDIR/dumbhttp.py -p $HGPORT1 --pid http.pid
561 $ "$PYTHON" $TESTDIR/dumbhttp.py -p $HGPORT1 --pid http.pid
562 $ cat http.pid >> $DAEMON_PIDS
562 $ cat http.pid >> $DAEMON_PIDS
563 $ hg -R server serve -d -p $HGPORT --pid-file hg.pid --accesslog access.log
563 $ hg -R server serve -d -p $HGPORT --pid-file hg.pid --accesslog access.log
564 $ cat hg.pid >> $DAEMON_PIDS
564 $ cat hg.pid >> $DAEMON_PIDS
565
565
566 $ cat > server/.hg/clonebundles.manifest << EOF
566 $ cat > server/.hg/clonebundles.manifest << EOF
567 > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2 REQUIREDRAM=12MB
567 > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2 REQUIREDRAM=12MB
568 > EOF
568 > EOF
569
569
570 $ hg clone -U --debug --config ui.available-memory=16MB http://localhost:$HGPORT gzip-too-large
570 $ hg clone -U --debug --config ui.available-memory=16MB http://localhost:$HGPORT gzip-too-large
571 using http://localhost:$HGPORT/
571 using http://localhost:$HGPORT/
572 sending capabilities command
572 sending capabilities command
573 sending clonebundles command
573 sending clonebundles command
574 filtering http://localhost:$HGPORT1/gz-a.hg as it needs more than 2/3 of system memory
574 filtering http://localhost:$HGPORT1/gz-a.hg as it needs more than 2/3 of system memory
575 no compatible clone bundles available on server; falling back to regular clone
575 no compatible clone bundles available on server; falling back to regular clone
576 (you may want to report this to the server operator)
576 (you may want to report this to the server operator)
577 query 1; heads
577 query 1; heads
578 sending batch command
578 sending batch command
579 requesting all changes
579 requesting all changes
580 sending getbundle command
580 sending getbundle command
581 bundle2-input-bundle: with-transaction
581 bundle2-input-bundle: with-transaction
582 bundle2-input-part: "changegroup" (params: 1 mandatory 1 advisory) supported
582 bundle2-input-part: "changegroup" (params: 1 mandatory 1 advisory) supported
583 adding changesets
583 adding changesets
584 add changeset 53245c60e682
584 add changeset 53245c60e682
585 add changeset aaff8d2ffbbf
585 add changeset aaff8d2ffbbf
586 adding manifests
586 adding manifests
587 adding file changes
587 adding file changes
588 adding bar revisions
588 adding bar revisions
589 adding foo revisions
589 adding foo revisions
590 bundle2-input-part: total payload size 920
590 bundle2-input-part: total payload size 920
591 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
591 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
592 bundle2-input-part: "phase-heads" supported
592 bundle2-input-part: "phase-heads" supported
593 bundle2-input-part: total payload size 24
593 bundle2-input-part: total payload size 24
594 bundle2-input-bundle: 3 parts total
594 bundle2-input-bundle: 3 parts total
595 checking for updated bookmarks
595 checking for updated bookmarks
596 updating the branch cache
596 updating the branch cache
597 added 2 changesets with 2 changes to 2 files
597 added 2 changesets with 2 changes to 2 files
598 new changesets 53245c60e682:aaff8d2ffbbf
598 new changesets 53245c60e682:aaff8d2ffbbf
599 calling hook changegroup.lfiles: hgext.largefiles.reposetup.checkrequireslfiles
599 calling hook changegroup.lfiles: hgext.largefiles.reposetup.checkrequireslfiles
600 updating the branch cache
600 updating the branch cache
601 (sent 4 HTTP requests and * bytes; received * bytes in responses) (glob)
601 (sent 4 HTTP requests and * bytes; received * bytes in responses) (glob)
602
602
603 $ hg clone -U --debug --config ui.available-memory=32MB http://localhost:$HGPORT gzip-too-large2
603 $ hg clone -U --debug --config ui.available-memory=32MB http://localhost:$HGPORT gzip-too-large2
604 using http://localhost:$HGPORT/
604 using http://localhost:$HGPORT/
605 sending capabilities command
605 sending capabilities command
606 sending clonebundles command
606 sending clonebundles command
607 applying clone bundle from http://localhost:$HGPORT1/gz-a.hg
607 applying clone bundle from http://localhost:$HGPORT1/gz-a.hg
608 bundle2-input-bundle: 1 params with-transaction
608 bundle2-input-bundle: 1 params with-transaction
609 bundle2-input-part: "changegroup" (params: 1 mandatory 1 advisory) supported
609 bundle2-input-part: "changegroup" (params: 1 mandatory 1 advisory) supported
610 adding changesets
610 adding changesets
611 add changeset 53245c60e682
611 add changeset 53245c60e682
612 add changeset aaff8d2ffbbf
612 add changeset aaff8d2ffbbf
613 adding manifests
613 adding manifests
614 adding file changes
614 adding file changes
615 adding bar revisions
615 adding bar revisions
616 adding foo revisions
616 adding foo revisions
617 bundle2-input-part: total payload size 920
617 bundle2-input-part: total payload size 920
618 bundle2-input-part: "cache:rev-branch-cache" (advisory) supported
618 bundle2-input-part: "cache:rev-branch-cache" (advisory) supported
619 bundle2-input-part: total payload size 59
619 bundle2-input-part: total payload size 59
620 bundle2-input-bundle: 2 parts total
620 bundle2-input-bundle: 2 parts total
621 updating the branch cache
621 updating the branch cache
622 added 2 changesets with 2 changes to 2 files
622 added 2 changesets with 2 changes to 2 files
623 finished applying clone bundle
623 finished applying clone bundle
624 query 1; heads
624 query 1; heads
625 sending batch command
625 sending batch command
626 searching for changes
626 searching for changes
627 all remote heads known locally
627 all remote heads known locally
628 no changes found
628 no changes found
629 sending getbundle command
629 sending getbundle command
630 bundle2-input-bundle: with-transaction
630 bundle2-input-bundle: with-transaction
631 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
631 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
632 bundle2-input-part: "phase-heads" supported
632 bundle2-input-part: "phase-heads" supported
633 bundle2-input-part: total payload size 24
633 bundle2-input-part: total payload size 24
634 bundle2-input-bundle: 2 parts total
634 bundle2-input-bundle: 2 parts total
635 checking for updated bookmarks
635 checking for updated bookmarks
636 2 local changesets published
636 2 local changesets published
637 calling hook changegroup.lfiles: hgext.largefiles.reposetup.checkrequireslfiles
637 calling hook changegroup.lfiles: hgext.largefiles.reposetup.checkrequireslfiles
638 updating the branch cache
638 updating the branch cache
639 (sent 4 HTTP requests and * bytes; received * bytes in responses) (glob)
639 (sent 4 HTTP requests and * bytes; received * bytes in responses) (glob)
640 $ killdaemons.py
640 $ killdaemons.py
641
642 Testing a clone bundles that involves revlog splitting (issue6811)
643 ==================================================================
644
645 $ cat >> $HGRCPATH << EOF
646 > [format]
647 > revlog-compression=none
648 > use-persistent-nodemap=no
649 > EOF
650
651 $ hg init server-revlog-split/
652 $ cd server-revlog-split
653 $ cat >> .hg/hgrc << EOF
654 > [extensions]
655 > clonebundles =
656 > EOF
657 $ echo foo > A
658 $ hg add A
659 $ hg commit -m 'initial commit'
660 IMPORTANT: the revlogs must not be split
661 $ ls -1 .hg/store/00manifest.*
662 .hg/store/00manifest.i
663 $ ls -1 .hg/store/data/_a.*
664 .hg/store/data/_a.i
665
666 do big enough update to split the revlogs
667
668 $ $TESTDIR/seq.py 100000 > A
669 $ mkdir foo
670 $ cd foo
671 $ touch `$TESTDIR/seq.py 10000`
672 $ cd ..
673 $ hg add -q foo
674 $ hg commit -m 'split the manifest and one filelog'
675
676 IMPORTANT: now the revlogs must be split
677 $ ls -1 .hg/store/00manifest.*
678 .hg/store/00manifest.d
679 .hg/store/00manifest.i
680 $ ls -1 .hg/store/data/_a.*
681 .hg/store/data/_a.d
682 .hg/store/data/_a.i
683
684 Add an extra commit on top of that
685
686 $ echo foo >> A
687 $ hg commit -m 'one extra commit'
688
689 $ cd ..
690
691 Do a bundle that contains the split, but not the update
692
693 $ hg bundle --exact --rev '::(default~1)' -R server-revlog-split/ --type gzip-v2 split-test.hg
694 2 changesets found
695
696 $ cat > server-revlog-split/.hg/clonebundles.manifest << EOF
697 > http://localhost:$HGPORT1/split-test.hg BUNDLESPEC=gzip-v2
698 > EOF
699
700 start the necessary server
701
702 $ "$PYTHON" $TESTDIR/dumbhttp.py -p $HGPORT1 --pid http.pid
703 $ cat http.pid >> $DAEMON_PIDS
704 $ hg -R server-revlog-split serve -d -p $HGPORT --pid-file hg.pid --accesslog access.log
705 $ cat hg.pid >> $DAEMON_PIDS
706
707 Check that clone works fine
708 ===========================
709
710 Here, the initial clone will trigger a revlog split (which is a bit clowny it
711 itself, but whatever). The split revlogs will see additionnal data added to
712 them in the subsequent pull. This should not be a problem
713
714 $ hg clone http://localhost:$HGPORT revlog-split-in-the-bundle
715 applying clone bundle from http://localhost:$HGPORT1/split-test.hg
716 adding changesets
717 adding manifests
718 adding file changes
719 added 2 changesets with 10002 changes to 10001 files
720 finished applying clone bundle
721 searching for changes
722 adding changesets
723 adding manifests
724 adding file changes
725 added 1 changesets with 1 changes to 1 files
726 new changesets e3879eaa1db7
727 2 local changesets published
728 updating to branch default
729 10001 files updated, 0 files merged, 0 files removed, 0 files unresolved
730
731 check the results
732
733 $ cd revlog-split-in-the-bundle
734 $ f --size .hg/store/00manifest.*
735 .hg/store/00manifest.d: size=499037
736 .hg/store/00manifest.i: size=192 (missing-correct-output !)
737 .hg/store/00manifest.i: size=128 (known-bad-output !)
738 .hg/store/00manifest.i.s: size=64 (known-bad-output !)
739 $ f --size .hg/store/data/_a.*
740 .hg/store/data/_a.d: size=588917
741 .hg/store/data/_a.i: size=192
742
743 manifest should work
744
745 $ hg files -r tip | wc -l
746 \s*10001 (re) (missing-correct-output !)
747 abort: 00manifest@4941afd6b8e298d932227572c5c303cbc14301bd: no node (known-bad-output !)
748 0 (known-bad-output !)
749
750 file content should work
751
752 $ hg cat -r tip A | wc -l
753 \s*100001 (re) (missing-correct-output !)
754 abort: 00manifest@4941afd6b8e298d932227572c5c303cbc14301bd: no node (known-bad-output !)
755 0 (known-bad-output !)
756
757
General Comments 0
You need to be logged in to leave comments. Login now