##// END OF EJS Templates
tests: add tests for clone bundles with --uncompressed...
Gregory Szorc -
r34359:880e4735 default
parent child Browse files
Show More
@@ -1,433 +1,503 b''
1 Set up a server
1 Set up a server
2
2
3 $ cat >> $HGRCPATH << EOF
3 $ cat >> $HGRCPATH << EOF
4 > [format]
4 > [format]
5 > usegeneraldelta=yes
5 > usegeneraldelta=yes
6 > EOF
6 > EOF
7 $ hg init server
7 $ hg init server
8 $ cd server
8 $ cd server
9 $ cat >> .hg/hgrc << EOF
9 $ cat >> .hg/hgrc << EOF
10 > [extensions]
10 > [extensions]
11 > clonebundles =
11 > clonebundles =
12 > EOF
12 > EOF
13
13
14 $ touch foo
14 $ touch foo
15 $ hg -q commit -A -m 'add foo'
15 $ hg -q commit -A -m 'add foo'
16 $ touch bar
16 $ touch bar
17 $ hg -q commit -A -m 'add bar'
17 $ hg -q commit -A -m 'add bar'
18
18
19 $ hg serve -d -p $HGPORT --pid-file hg.pid --accesslog access.log
19 $ hg serve -d -p $HGPORT --pid-file hg.pid --accesslog access.log
20 $ cat hg.pid >> $DAEMON_PIDS
20 $ cat hg.pid >> $DAEMON_PIDS
21 $ cd ..
21 $ cd ..
22
22
23 Missing manifest should not result in server lookup
23 Missing manifest should not result in server lookup
24
24
25 $ hg --verbose clone -U http://localhost:$HGPORT no-manifest
25 $ hg --verbose clone -U http://localhost:$HGPORT no-manifest
26 requesting all changes
26 requesting all changes
27 adding changesets
27 adding changesets
28 adding manifests
28 adding manifests
29 adding file changes
29 adding file changes
30 added 2 changesets with 2 changes to 2 files
30 added 2 changesets with 2 changes to 2 files
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 * - - [*] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
34 * - - [*] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
35 * - - [*] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Aphases%253Dheads%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=1&common=0000000000000000000000000000000000000000&heads=aaff8d2ffbbf07a46dd1f05d8ae7877e3f56e2a2&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=*,zlib,none,bzip2 (glob)
35 * - - [*] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Aphases%253Dheads%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=1&common=0000000000000000000000000000000000000000&heads=aaff8d2ffbbf07a46dd1f05d8ae7877e3f56e2a2&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=*,zlib,none,bzip2 (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
48
49 Manifest file with invalid URL aborts
49 Manifest file with invalid URL aborts
50
50
51 $ echo 'http://does.not.exist/bundle.hg' > server/.hg/clonebundles.manifest
51 $ echo 'http://does.not.exist/bundle.hg' > server/.hg/clonebundles.manifest
52 $ hg clone http://localhost:$HGPORT 404-url
52 $ hg clone http://localhost:$HGPORT 404-url
53 applying clone bundle from http://does.not.exist/bundle.hg
53 applying clone bundle from http://does.not.exist/bundle.hg
54 error fetching bundle: (.* not known|No address associated with hostname) (re) (no-windows !)
54 error fetching bundle: (.* not known|No address associated with hostname) (re) (no-windows !)
55 error fetching bundle: [Errno 11004] getaddrinfo failed (windows !)
55 error fetching bundle: [Errno 11004] getaddrinfo failed (windows !)
56 abort: error applying bundle
56 abort: error applying bundle
57 (if this error persists, consider contacting the server operator or disable clone bundles via "--config ui.clonebundles=false")
57 (if this error persists, consider contacting the server operator or disable clone bundles via "--config ui.clonebundles=false")
58 [255]
58 [255]
59
59
60 Server is not running aborts
60 Server is not running aborts
61
61
62 $ echo "http://localhost:$HGPORT1/bundle.hg" > server/.hg/clonebundles.manifest
62 $ echo "http://localhost:$HGPORT1/bundle.hg" > server/.hg/clonebundles.manifest
63 $ hg clone http://localhost:$HGPORT server-not-runner
63 $ hg clone http://localhost:$HGPORT server-not-runner
64 applying clone bundle from http://localhost:$HGPORT1/bundle.hg
64 applying clone bundle from http://localhost:$HGPORT1/bundle.hg
65 error fetching bundle: (.* refused.*|Protocol not supported|(.* )?Cannot assign requested address) (re)
65 error fetching bundle: (.* refused.*|Protocol not supported|(.* )?Cannot assign requested address) (re)
66 abort: error applying bundle
66 abort: error applying bundle
67 (if this error persists, consider contacting the server operator or disable clone bundles via "--config ui.clonebundles=false")
67 (if this error persists, consider contacting the server operator or disable clone bundles via "--config ui.clonebundles=false")
68 [255]
68 [255]
69
69
70 Server returns 404
70 Server returns 404
71
71
72 $ "$PYTHON" $TESTDIR/dumbhttp.py -p $HGPORT1 --pid http.pid
72 $ "$PYTHON" $TESTDIR/dumbhttp.py -p $HGPORT1 --pid http.pid
73 $ cat http.pid >> $DAEMON_PIDS
73 $ cat http.pid >> $DAEMON_PIDS
74 $ hg clone http://localhost:$HGPORT running-404
74 $ hg clone http://localhost:$HGPORT running-404
75 applying clone bundle from http://localhost:$HGPORT1/bundle.hg
75 applying clone bundle from http://localhost:$HGPORT1/bundle.hg
76 HTTP error fetching bundle: HTTP Error 404: File not found
76 HTTP error fetching bundle: HTTP Error 404: File not found
77 abort: error applying bundle
77 abort: error applying bundle
78 (if this error persists, consider contacting the server operator or disable clone bundles via "--config ui.clonebundles=false")
78 (if this error persists, consider contacting the server operator or disable clone bundles via "--config ui.clonebundles=false")
79 [255]
79 [255]
80
80
81 We can override failure to fall back to regular clone
81 We can override failure to fall back to regular clone
82
82
83 $ hg --config ui.clonebundlefallback=true clone -U http://localhost:$HGPORT 404-fallback
83 $ hg --config ui.clonebundlefallback=true clone -U http://localhost:$HGPORT 404-fallback
84 applying clone bundle from http://localhost:$HGPORT1/bundle.hg
84 applying clone bundle from http://localhost:$HGPORT1/bundle.hg
85 HTTP error fetching bundle: HTTP Error 404: File not found
85 HTTP error fetching bundle: HTTP Error 404: File not found
86 falling back to normal clone
86 falling back to normal clone
87 requesting all changes
87 requesting all changes
88 adding changesets
88 adding changesets
89 adding manifests
89 adding manifests
90 adding file changes
90 adding file changes
91 added 2 changesets with 2 changes to 2 files
91 added 2 changesets with 2 changes to 2 files
92
92
93 Bundle with partial content works
93 Bundle with partial content works
94
94
95 $ hg -R server bundle --type gzip-v1 --base null -r 53245c60e682 partial.hg
95 $ hg -R server bundle --type gzip-v1 --base null -r 53245c60e682 partial.hg
96 1 changesets found
96 1 changesets found
97
97
98 We verify exact bundle content as an extra check against accidental future
98 We verify exact bundle content as an extra check against accidental future
99 changes. If this output changes, we could break old clients.
99 changes. If this output changes, we could break old clients.
100
100
101 $ f --size --hexdump partial.hg
101 $ f --size --hexdump partial.hg
102 partial.hg: size=207
102 partial.hg: size=207
103 0000: 48 47 31 30 47 5a 78 9c 63 60 60 98 17 ac 12 93 |HG10GZx.c``.....|
103 0000: 48 47 31 30 47 5a 78 9c 63 60 60 98 17 ac 12 93 |HG10GZx.c``.....|
104 0010: f0 ac a9 23 45 70 cb bf 0d 5f 59 4e 4a 7f 79 21 |...#Ep..._YNJ.y!|
104 0010: f0 ac a9 23 45 70 cb bf 0d 5f 59 4e 4a 7f 79 21 |...#Ep..._YNJ.y!|
105 0020: 9b cc 40 24 20 a0 d7 ce 2c d1 38 25 cd 24 25 d5 |..@$ ...,.8%.$%.|
105 0020: 9b cc 40 24 20 a0 d7 ce 2c d1 38 25 cd 24 25 d5 |..@$ ...,.8%.$%.|
106 0030: d8 c2 22 cd 38 d9 24 cd 22 d5 c8 22 cd 24 cd 32 |..".8.$."..".$.2|
106 0030: d8 c2 22 cd 38 d9 24 cd 22 d5 c8 22 cd 24 cd 32 |..".8.$."..".$.2|
107 0040: d1 c2 d0 c4 c8 d2 32 d1 38 39 29 c9 34 cd d4 80 |......2.89).4...|
107 0040: d1 c2 d0 c4 c8 d2 32 d1 38 39 29 c9 34 cd d4 80 |......2.89).4...|
108 0050: ab 24 b5 b8 84 cb 40 c1 80 2b 2d 3f 9f 8b 2b 31 |.$....@..+-?..+1|
108 0050: ab 24 b5 b8 84 cb 40 c1 80 2b 2d 3f 9f 8b 2b 31 |.$....@..+-?..+1|
109 0060: 25 45 01 c8 80 9a d2 9b 65 fb e5 9e 45 bf 8d 7f |%E......e...E...|
109 0060: 25 45 01 c8 80 9a d2 9b 65 fb e5 9e 45 bf 8d 7f |%E......e...E...|
110 0070: 9f c6 97 9f 2b 44 34 67 d9 ec 8e 0f a0 92 0b 75 |....+D4g.......u|
110 0070: 9f c6 97 9f 2b 44 34 67 d9 ec 8e 0f a0 92 0b 75 |....+D4g.......u|
111 0080: 41 d6 24 59 18 a4 a4 9a a6 18 1a 5b 98 9b 5a 98 |A.$Y.......[..Z.|
111 0080: 41 d6 24 59 18 a4 a4 9a a6 18 1a 5b 98 9b 5a 98 |A.$Y.......[..Z.|
112 0090: 9a 18 26 9b a6 19 98 1a 99 99 26 a6 18 9a 98 24 |..&.......&....$|
112 0090: 9a 18 26 9b a6 19 98 1a 99 99 26 a6 18 9a 98 24 |..&.......&....$|
113 00a0: 26 59 a6 25 5a 98 a5 18 a6 24 71 41 35 b1 43 dc |&Y.%Z....$qA5.C.|
113 00a0: 26 59 a6 25 5a 98 a5 18 a6 24 71 41 35 b1 43 dc |&Y.%Z....$qA5.C.|
114 00b0: 16 b2 83 f7 e9 45 8b d2 56 c7 a3 1f 82 52 d7 8a |.....E..V....R..|
114 00b0: 16 b2 83 f7 e9 45 8b d2 56 c7 a3 1f 82 52 d7 8a |.....E..V....R..|
115 00c0: 78 ed fc d5 76 f1 36 35 dc 05 00 36 ed 5e c7 |x...v.65...6.^.|
115 00c0: 78 ed fc d5 76 f1 36 35 dc 05 00 36 ed 5e c7 |x...v.65...6.^.|
116
116
117 $ echo "http://localhost:$HGPORT1/partial.hg" > server/.hg/clonebundles.manifest
117 $ echo "http://localhost:$HGPORT1/partial.hg" > server/.hg/clonebundles.manifest
118 $ hg clone -U http://localhost:$HGPORT partial-bundle
118 $ hg clone -U http://localhost:$HGPORT partial-bundle
119 applying clone bundle from http://localhost:$HGPORT1/partial.hg
119 applying clone bundle from http://localhost:$HGPORT1/partial.hg
120 adding changesets
120 adding changesets
121 adding manifests
121 adding manifests
122 adding file changes
122 adding file changes
123 added 1 changesets with 1 changes to 1 files
123 added 1 changesets with 1 changes to 1 files
124 finished applying clone bundle
124 finished applying clone bundle
125 searching for changes
125 searching for changes
126 adding changesets
126 adding changesets
127 adding manifests
127 adding manifests
128 adding file changes
128 adding file changes
129 added 1 changesets with 1 changes to 1 files
129 added 1 changesets with 1 changes to 1 files
130
130
131 Incremental pull doesn't fetch bundle
131 Incremental pull doesn't fetch bundle
132
132
133 $ hg clone -r 53245c60e682 -U http://localhost:$HGPORT partial-clone
133 $ hg clone -r 53245c60e682 -U http://localhost:$HGPORT partial-clone
134 adding changesets
134 adding changesets
135 adding manifests
135 adding manifests
136 adding file changes
136 adding file changes
137 added 1 changesets with 1 changes to 1 files
137 added 1 changesets with 1 changes to 1 files
138
138
139 $ cd partial-clone
139 $ cd partial-clone
140 $ hg pull
140 $ hg pull
141 pulling from http://localhost:$HGPORT/
141 pulling from http://localhost:$HGPORT/
142 searching for changes
142 searching for changes
143 adding changesets
143 adding changesets
144 adding manifests
144 adding manifests
145 adding file changes
145 adding file changes
146 added 1 changesets with 1 changes to 1 files
146 added 1 changesets with 1 changes to 1 files
147 (run 'hg update' to get a working copy)
147 (run 'hg update' to get a working copy)
148 $ cd ..
148 $ cd ..
149
149
150 Bundle with full content works
150 Bundle with full content works
151
151
152 $ hg -R server bundle --type gzip-v2 --base null -r tip full.hg
152 $ hg -R server bundle --type gzip-v2 --base null -r tip full.hg
153 2 changesets found
153 2 changesets found
154
154
155 Again, we perform an extra check against bundle content changes. If this content
155 Again, we perform an extra check against bundle content changes. If this content
156 changes, clone bundles produced by new Mercurial versions may not be readable
156 changes, clone bundles produced by new Mercurial versions may not be readable
157 by old clients.
157 by old clients.
158
158
159 $ f --size --hexdump full.hg
159 $ f --size --hexdump full.hg
160 full.hg: size=396
160 full.hg: size=396
161 0000: 48 47 32 30 00 00 00 0e 43 6f 6d 70 72 65 73 73 |HG20....Compress|
161 0000: 48 47 32 30 00 00 00 0e 43 6f 6d 70 72 65 73 73 |HG20....Compress|
162 0010: 69 6f 6e 3d 47 5a 78 9c 63 60 60 d0 e4 76 f6 70 |ion=GZx.c``..v.p|
162 0010: 69 6f 6e 3d 47 5a 78 9c 63 60 60 d0 e4 76 f6 70 |ion=GZx.c``..v.p|
163 0020: f4 73 77 75 0f f2 0f 0d 60 00 02 46 46 76 26 4e |.swu....`..FFv&N|
163 0020: f4 73 77 75 0f f2 0f 0d 60 00 02 46 46 76 26 4e |.swu....`..FFv&N|
164 0030: c6 b2 d4 a2 e2 cc fc 3c 03 a3 bc a4 e4 8c c4 bc |.......<........|
164 0030: c6 b2 d4 a2 e2 cc fc 3c 03 a3 bc a4 e4 8c c4 bc |.......<........|
165 0040: f4 d4 62 23 06 06 e6 19 40 f9 4d c1 2a 31 09 cf |..b#....@.M.*1..|
165 0040: f4 d4 62 23 06 06 e6 19 40 f9 4d c1 2a 31 09 cf |..b#....@.M.*1..|
166 0050: 9a 3a 52 04 b7 fc db f0 95 e5 a4 f4 97 17 b2 c9 |.:R.............|
166 0050: 9a 3a 52 04 b7 fc db f0 95 e5 a4 f4 97 17 b2 c9 |.:R.............|
167 0060: 0c 14 00 02 e6 d9 99 25 1a a7 a4 99 a4 a4 1a 5b |.......%.......[|
167 0060: 0c 14 00 02 e6 d9 99 25 1a a7 a4 99 a4 a4 1a 5b |.......%.......[|
168 0070: 58 a4 19 27 9b a4 59 a4 1a 59 a4 99 a4 59 26 5a |X..'..Y..Y...Y&Z|
168 0070: 58 a4 19 27 9b a4 59 a4 1a 59 a4 99 a4 59 26 5a |X..'..Y..Y...Y&Z|
169 0080: 18 9a 18 59 5a 26 1a 27 27 25 99 a6 99 1a 70 95 |...YZ&.''%....p.|
169 0080: 18 9a 18 59 5a 26 1a 27 27 25 99 a6 99 1a 70 95 |...YZ&.''%....p.|
170 0090: a4 16 97 70 19 28 18 70 a5 e5 e7 73 71 25 a6 a4 |...p.(.p...sq%..|
170 0090: a4 16 97 70 19 28 18 70 a5 e5 e7 73 71 25 a6 a4 |...p.(.p...sq%..|
171 00a0: 28 00 19 20 17 af fa df ab ff 7b 3f fb 92 dc 8b |(.. ......{?....|
171 00a0: 28 00 19 20 17 af fa df ab ff 7b 3f fb 92 dc 8b |(.. ......{?....|
172 00b0: 1f 62 bb 9e b7 d7 d9 87 3d 5a 44 89 2f b0 99 87 |.b......=ZD./...|
172 00b0: 1f 62 bb 9e b7 d7 d9 87 3d 5a 44 89 2f b0 99 87 |.b......=ZD./...|
173 00c0: ec e2 54 63 43 e3 b4 64 43 73 23 33 43 53 0b 63 |..TcC..dCs#3CS.c|
173 00c0: ec e2 54 63 43 e3 b4 64 43 73 23 33 43 53 0b 63 |..TcC..dCs#3CS.c|
174 00d0: d3 14 23 03 a0 fb 2c 2c 0c d3 80 1e 30 49 49 b1 |..#...,,....0II.|
174 00d0: d3 14 23 03 a0 fb 2c 2c 0c d3 80 1e 30 49 49 b1 |..#...,,....0II.|
175 00e0: 4c 4a 32 48 33 30 b0 34 42 b8 38 29 b1 08 e2 62 |LJ2H30.4B.8)...b|
175 00e0: 4c 4a 32 48 33 30 b0 34 42 b8 38 29 b1 08 e2 62 |LJ2H30.4B.8)...b|
176 00f0: 20 03 6a ca c2 2c db 2f f7 2c fa 6d fc fb 34 be | .j..,./.,.m..4.|
176 00f0: 20 03 6a ca c2 2c db 2f f7 2c fa 6d fc fb 34 be | .j..,./.,.m..4.|
177 0100: fc 5c 21 a2 39 cb 66 77 7c 00 0d c3 59 17 14 58 |.\!.9.fw|...Y..X|
177 0100: fc 5c 21 a2 39 cb 66 77 7c 00 0d c3 59 17 14 58 |.\!.9.fw|...Y..X|
178 0110: 49 16 06 29 a9 a6 29 86 c6 16 e6 a6 16 a6 26 86 |I..)..).......&.|
178 0110: 49 16 06 29 a9 a6 29 86 c6 16 e6 a6 16 a6 26 86 |I..)..).......&.|
179 0120: c9 a6 69 06 a6 46 66 a6 89 29 86 26 26 89 49 96 |..i..Ff..).&&.I.|
179 0120: c9 a6 69 06 a6 46 66 a6 89 29 86 26 26 89 49 96 |..i..Ff..).&&.I.|
180 0130: 69 89 16 66 29 86 29 49 5c 20 07 3e 16 fe 23 ae |i..f).)I\ .>..#.|
180 0130: 69 89 16 66 29 86 29 49 5c 20 07 3e 16 fe 23 ae |i..f).)I\ .>..#.|
181 0140: 26 da 1c ab 10 1f d1 f8 e3 b3 ef cd dd fc 0c 93 |&...............|
181 0140: 26 da 1c ab 10 1f d1 f8 e3 b3 ef cd dd fc 0c 93 |&...............|
182 0150: 88 75 34 36 75 04 82 55 17 14 36 a4 38 10 04 d8 |.u46u..U..6.8...|
182 0150: 88 75 34 36 75 04 82 55 17 14 36 a4 38 10 04 d8 |.u46u..U..6.8...|
183 0160: 21 01 9a b1 83 f7 e9 45 8b d2 56 c7 a3 1f 82 52 |!......E..V....R|
183 0160: 21 01 9a b1 83 f7 e9 45 8b d2 56 c7 a3 1f 82 52 |!......E..V....R|
184 0170: d7 8a 78 ed fc d5 76 f1 36 25 81 89 c7 ad ec 90 |..x...v.6%......|
184 0170: d7 8a 78 ed fc d5 76 f1 36 25 81 89 c7 ad ec 90 |..x...v.6%......|
185 0180: 54 47 75 2b 89 49 b1 00 d2 8a eb 92 |TGu+.I......|
185 0180: 54 47 75 2b 89 49 b1 00 d2 8a eb 92 |TGu+.I......|
186
186
187 $ echo "http://localhost:$HGPORT1/full.hg" > server/.hg/clonebundles.manifest
187 $ echo "http://localhost:$HGPORT1/full.hg" > server/.hg/clonebundles.manifest
188 $ hg clone -U http://localhost:$HGPORT full-bundle
188 $ hg clone -U http://localhost:$HGPORT full-bundle
189 applying clone bundle from http://localhost:$HGPORT1/full.hg
189 applying clone bundle from http://localhost:$HGPORT1/full.hg
190 adding changesets
190 adding changesets
191 adding manifests
191 adding manifests
192 adding file changes
192 adding file changes
193 added 2 changesets with 2 changes to 2 files
193 added 2 changesets with 2 changes to 2 files
194 finished applying clone bundle
194 finished applying clone bundle
195 searching for changes
195 searching for changes
196 no changes found
196 no changes found
197
197
198 Feature works over SSH
198 Feature works over SSH
199
199
200 $ hg clone -U -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/server ssh-full-clone
200 $ hg clone -U -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/server ssh-full-clone
201 applying clone bundle from http://localhost:$HGPORT1/full.hg
201 applying clone bundle from http://localhost:$HGPORT1/full.hg
202 adding changesets
202 adding changesets
203 adding manifests
203 adding manifests
204 adding file changes
204 adding file changes
205 added 2 changesets with 2 changes to 2 files
205 added 2 changesets with 2 changes to 2 files
206 finished applying clone bundle
206 finished applying clone bundle
207 searching for changes
207 searching for changes
208 no changes found
208 no changes found
209
209
210 Entry with unknown BUNDLESPEC is filtered and not used
210 Entry with unknown BUNDLESPEC is filtered and not used
211
211
212 $ cat > server/.hg/clonebundles.manifest << EOF
212 $ cat > server/.hg/clonebundles.manifest << EOF
213 > http://bad.entry1 BUNDLESPEC=UNKNOWN
213 > http://bad.entry1 BUNDLESPEC=UNKNOWN
214 > http://bad.entry2 BUNDLESPEC=xz-v1
214 > http://bad.entry2 BUNDLESPEC=xz-v1
215 > http://bad.entry3 BUNDLESPEC=none-v100
215 > http://bad.entry3 BUNDLESPEC=none-v100
216 > http://localhost:$HGPORT1/full.hg BUNDLESPEC=gzip-v2
216 > http://localhost:$HGPORT1/full.hg BUNDLESPEC=gzip-v2
217 > EOF
217 > EOF
218
218
219 $ hg clone -U http://localhost:$HGPORT filter-unknown-type
219 $ hg clone -U http://localhost:$HGPORT filter-unknown-type
220 applying clone bundle from http://localhost:$HGPORT1/full.hg
220 applying clone bundle from http://localhost:$HGPORT1/full.hg
221 adding changesets
221 adding changesets
222 adding manifests
222 adding manifests
223 adding file changes
223 adding file changes
224 added 2 changesets with 2 changes to 2 files
224 added 2 changesets with 2 changes to 2 files
225 finished applying clone bundle
225 finished applying clone bundle
226 searching for changes
226 searching for changes
227 no changes found
227 no changes found
228
228
229 Automatic fallback when all entries are filtered
229 Automatic fallback when all entries are filtered
230
230
231 $ cat > server/.hg/clonebundles.manifest << EOF
231 $ cat > server/.hg/clonebundles.manifest << EOF
232 > http://bad.entry BUNDLESPEC=UNKNOWN
232 > http://bad.entry BUNDLESPEC=UNKNOWN
233 > EOF
233 > EOF
234
234
235 $ hg clone -U http://localhost:$HGPORT filter-all
235 $ hg clone -U http://localhost:$HGPORT filter-all
236 no compatible clone bundles available on server; falling back to regular clone
236 no compatible clone bundles available on server; falling back to regular clone
237 (you may want to report this to the server operator)
237 (you may want to report this to the server operator)
238 requesting all changes
238 requesting all changes
239 adding changesets
239 adding changesets
240 adding manifests
240 adding manifests
241 adding file changes
241 adding file changes
242 added 2 changesets with 2 changes to 2 files
242 added 2 changesets with 2 changes to 2 files
243
243
244 URLs requiring SNI are filtered in Python <2.7.9
244 URLs requiring SNI are filtered in Python <2.7.9
245
245
246 $ cp full.hg sni.hg
246 $ cp full.hg sni.hg
247 $ cat > server/.hg/clonebundles.manifest << EOF
247 $ cat > server/.hg/clonebundles.manifest << EOF
248 > http://localhost:$HGPORT1/sni.hg REQUIRESNI=true
248 > http://localhost:$HGPORT1/sni.hg REQUIRESNI=true
249 > http://localhost:$HGPORT1/full.hg
249 > http://localhost:$HGPORT1/full.hg
250 > EOF
250 > EOF
251
251
252 #if sslcontext
252 #if sslcontext
253 Python 2.7.9+ support SNI
253 Python 2.7.9+ support SNI
254
254
255 $ hg clone -U http://localhost:$HGPORT sni-supported
255 $ hg clone -U http://localhost:$HGPORT sni-supported
256 applying clone bundle from http://localhost:$HGPORT1/sni.hg
256 applying clone bundle from http://localhost:$HGPORT1/sni.hg
257 adding changesets
257 adding changesets
258 adding manifests
258 adding manifests
259 adding file changes
259 adding file changes
260 added 2 changesets with 2 changes to 2 files
260 added 2 changesets with 2 changes to 2 files
261 finished applying clone bundle
261 finished applying clone bundle
262 searching for changes
262 searching for changes
263 no changes found
263 no changes found
264 #else
264 #else
265 Python <2.7.9 will filter SNI URLs
265 Python <2.7.9 will filter SNI URLs
266
266
267 $ hg clone -U http://localhost:$HGPORT sni-unsupported
267 $ hg clone -U http://localhost:$HGPORT sni-unsupported
268 applying clone bundle from http://localhost:$HGPORT1/full.hg
268 applying clone bundle from http://localhost:$HGPORT1/full.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 #endif
276 #endif
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
282 bundle requirements: generaldelta, revlogv1
283
283
284 No bundle spec should work
284 No bundle spec should work
285
285
286 $ cat > server/.hg/clonebundles.manifest << EOF
286 $ cat > server/.hg/clonebundles.manifest << EOF
287 > http://localhost:$HGPORT1/packed.hg
287 > http://localhost:$HGPORT1/packed.hg
288 > EOF
288 > EOF
289
289
290 $ hg clone -U http://localhost:$HGPORT stream-clone-no-spec
290 $ hg clone -U http://localhost:$HGPORT stream-clone-no-spec
291 applying clone bundle from http://localhost:$HGPORT1/packed.hg
291 applying clone bundle from http://localhost:$HGPORT1/packed.hg
292 4 files to transfer, 613 bytes of data
292 4 files to transfer, 613 bytes of data
293 transferred 613 bytes in *.* seconds (*) (glob)
293 transferred 613 bytes in *.* seconds (*) (glob)
294 finished applying clone bundle
294 finished applying clone bundle
295 searching for changes
295 searching for changes
296 no changes found
296 no changes found
297
297
298 Bundle spec without parameters should work
298 Bundle spec without parameters should work
299
299
300 $ cat > server/.hg/clonebundles.manifest << EOF
300 $ cat > server/.hg/clonebundles.manifest << EOF
301 > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1
301 > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1
302 > EOF
302 > EOF
303
303
304 $ hg clone -U http://localhost:$HGPORT stream-clone-vanilla-spec
304 $ hg clone -U http://localhost:$HGPORT stream-clone-vanilla-spec
305 applying clone bundle from http://localhost:$HGPORT1/packed.hg
305 applying clone bundle from http://localhost:$HGPORT1/packed.hg
306 4 files to transfer, 613 bytes of data
306 4 files to transfer, 613 bytes of data
307 transferred 613 bytes in *.* seconds (*) (glob)
307 transferred 613 bytes in *.* seconds (*) (glob)
308 finished applying clone bundle
308 finished applying clone bundle
309 searching for changes
309 searching for changes
310 no changes found
310 no changes found
311
311
312 Bundle spec with format requirements should work
312 Bundle spec with format requirements should work
313
313
314 $ cat > server/.hg/clonebundles.manifest << EOF
314 $ cat > server/.hg/clonebundles.manifest << EOF
315 > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1;requirements%3Drevlogv1
315 > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1;requirements%3Drevlogv1
316 > EOF
316 > EOF
317
317
318 $ hg clone -U http://localhost:$HGPORT stream-clone-supported-requirements
318 $ hg clone -U http://localhost:$HGPORT stream-clone-supported-requirements
319 applying clone bundle from http://localhost:$HGPORT1/packed.hg
319 applying clone bundle from http://localhost:$HGPORT1/packed.hg
320 4 files to transfer, 613 bytes of data
320 4 files to transfer, 613 bytes of data
321 transferred 613 bytes in *.* seconds (*) (glob)
321 transferred 613 bytes in *.* seconds (*) (glob)
322 finished applying clone bundle
322 finished applying clone bundle
323 searching for changes
323 searching for changes
324 no changes found
324 no changes found
325
325
326 Stream bundle spec with unknown requirements should be filtered out
326 Stream bundle spec with unknown requirements should be filtered out
327
327
328 $ cat > server/.hg/clonebundles.manifest << EOF
328 $ cat > server/.hg/clonebundles.manifest << EOF
329 > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1;requirements%3Drevlogv42
329 > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1;requirements%3Drevlogv42
330 > EOF
330 > EOF
331
331
332 $ hg clone -U http://localhost:$HGPORT stream-clone-unsupported-requirements
332 $ hg clone -U http://localhost:$HGPORT stream-clone-unsupported-requirements
333 no compatible clone bundles available on server; falling back to regular clone
333 no compatible clone bundles available on server; falling back to regular clone
334 (you may want to report this to the server operator)
334 (you may want to report this to the server operator)
335 requesting all changes
335 requesting all changes
336 adding changesets
336 adding changesets
337 adding manifests
337 adding manifests
338 adding file changes
338 adding file changes
339 added 2 changesets with 2 changes to 2 files
339 added 2 changesets with 2 changes to 2 files
340
340
341 Set up manifest for testing preferences
341 Set up manifest for testing preferences
342 (Remember, the TYPE does not have to match reality - the URL is
342 (Remember, the TYPE does not have to match reality - the URL is
343 important)
343 important)
344
344
345 $ cp full.hg gz-a.hg
345 $ cp full.hg gz-a.hg
346 $ cp full.hg gz-b.hg
346 $ cp full.hg gz-b.hg
347 $ cp full.hg bz2-a.hg
347 $ cp full.hg bz2-a.hg
348 $ cp full.hg bz2-b.hg
348 $ cp full.hg bz2-b.hg
349 $ cat > server/.hg/clonebundles.manifest << EOF
349 $ cat > server/.hg/clonebundles.manifest << EOF
350 > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2 extra=a
350 > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2 extra=a
351 > http://localhost:$HGPORT1/bz2-a.hg BUNDLESPEC=bzip2-v2 extra=a
351 > http://localhost:$HGPORT1/bz2-a.hg BUNDLESPEC=bzip2-v2 extra=a
352 > http://localhost:$HGPORT1/gz-b.hg BUNDLESPEC=gzip-v2 extra=b
352 > http://localhost:$HGPORT1/gz-b.hg BUNDLESPEC=gzip-v2 extra=b
353 > http://localhost:$HGPORT1/bz2-b.hg BUNDLESPEC=bzip2-v2 extra=b
353 > http://localhost:$HGPORT1/bz2-b.hg BUNDLESPEC=bzip2-v2 extra=b
354 > EOF
354 > EOF
355
355
356 Preferring an undefined attribute will take first entry
356 Preferring an undefined attribute will take first entry
357
357
358 $ hg --config ui.clonebundleprefers=foo=bar clone -U http://localhost:$HGPORT prefer-foo
358 $ hg --config ui.clonebundleprefers=foo=bar clone -U http://localhost:$HGPORT prefer-foo
359 applying clone bundle from http://localhost:$HGPORT1/gz-a.hg
359 applying clone bundle from http://localhost:$HGPORT1/gz-a.hg
360 adding changesets
360 adding changesets
361 adding manifests
361 adding manifests
362 adding file changes
362 adding file changes
363 added 2 changesets with 2 changes to 2 files
363 added 2 changesets with 2 changes to 2 files
364 finished applying clone bundle
364 finished applying clone bundle
365 searching for changes
365 searching for changes
366 no changes found
366 no changes found
367
367
368 Preferring bz2 type will download first entry of that type
368 Preferring bz2 type will download first entry of that type
369
369
370 $ hg --config ui.clonebundleprefers=COMPRESSION=bzip2 clone -U http://localhost:$HGPORT prefer-bz
370 $ hg --config ui.clonebundleprefers=COMPRESSION=bzip2 clone -U http://localhost:$HGPORT prefer-bz
371 applying clone bundle from http://localhost:$HGPORT1/bz2-a.hg
371 applying clone bundle from http://localhost:$HGPORT1/bz2-a.hg
372 adding changesets
372 adding changesets
373 adding manifests
373 adding manifests
374 adding file changes
374 adding file changes
375 added 2 changesets with 2 changes to 2 files
375 added 2 changesets with 2 changes to 2 files
376 finished applying clone bundle
376 finished applying clone bundle
377 searching for changes
377 searching for changes
378 no changes found
378 no changes found
379
379
380 Preferring multiple values of an option works
380 Preferring multiple values of an option works
381
381
382 $ hg --config ui.clonebundleprefers=COMPRESSION=unknown,COMPRESSION=bzip2 clone -U http://localhost:$HGPORT prefer-multiple-bz
382 $ hg --config ui.clonebundleprefers=COMPRESSION=unknown,COMPRESSION=bzip2 clone -U http://localhost:$HGPORT prefer-multiple-bz
383 applying clone bundle from http://localhost:$HGPORT1/bz2-a.hg
383 applying clone bundle from http://localhost:$HGPORT1/bz2-a.hg
384 adding changesets
384 adding changesets
385 adding manifests
385 adding manifests
386 adding file changes
386 adding file changes
387 added 2 changesets with 2 changes to 2 files
387 added 2 changesets with 2 changes to 2 files
388 finished applying clone bundle
388 finished applying clone bundle
389 searching for changes
389 searching for changes
390 no changes found
390 no changes found
391
391
392 Sorting multiple values should get us back to original first entry
392 Sorting multiple values should get us back to original first entry
393
393
394 $ hg --config ui.clonebundleprefers=BUNDLESPEC=unknown,BUNDLESPEC=gzip-v2,BUNDLESPEC=bzip2-v2 clone -U http://localhost:$HGPORT prefer-multiple-gz
394 $ hg --config ui.clonebundleprefers=BUNDLESPEC=unknown,BUNDLESPEC=gzip-v2,BUNDLESPEC=bzip2-v2 clone -U http://localhost:$HGPORT prefer-multiple-gz
395 applying clone bundle from http://localhost:$HGPORT1/gz-a.hg
395 applying clone bundle from http://localhost:$HGPORT1/gz-a.hg
396 adding changesets
396 adding changesets
397 adding manifests
397 adding manifests
398 adding file changes
398 adding file changes
399 added 2 changesets with 2 changes to 2 files
399 added 2 changesets with 2 changes to 2 files
400 finished applying clone bundle
400 finished applying clone bundle
401 searching for changes
401 searching for changes
402 no changes found
402 no changes found
403
403
404 Preferring multiple attributes has correct order
404 Preferring multiple attributes has correct order
405
405
406 $ hg --config ui.clonebundleprefers=extra=b,BUNDLESPEC=bzip2-v2 clone -U http://localhost:$HGPORT prefer-separate-attributes
406 $ hg --config ui.clonebundleprefers=extra=b,BUNDLESPEC=bzip2-v2 clone -U http://localhost:$HGPORT prefer-separate-attributes
407 applying clone bundle from http://localhost:$HGPORT1/bz2-b.hg
407 applying clone bundle from http://localhost:$HGPORT1/bz2-b.hg
408 adding changesets
408 adding changesets
409 adding manifests
409 adding manifests
410 adding file changes
410 adding file changes
411 added 2 changesets with 2 changes to 2 files
411 added 2 changesets with 2 changes to 2 files
412 finished applying clone bundle
412 finished applying clone bundle
413 searching for changes
413 searching for changes
414 no changes found
414 no changes found
415
415
416 Test where attribute is missing from some entries
416 Test where attribute is missing from some entries
417
417
418 $ cat > server/.hg/clonebundles.manifest << EOF
418 $ cat > server/.hg/clonebundles.manifest << EOF
419 > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2
419 > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2
420 > http://localhost:$HGPORT1/bz2-a.hg BUNDLESPEC=bzip2-v2
420 > http://localhost:$HGPORT1/bz2-a.hg BUNDLESPEC=bzip2-v2
421 > http://localhost:$HGPORT1/gz-b.hg BUNDLESPEC=gzip-v2 extra=b
421 > http://localhost:$HGPORT1/gz-b.hg BUNDLESPEC=gzip-v2 extra=b
422 > http://localhost:$HGPORT1/bz2-b.hg BUNDLESPEC=bzip2-v2 extra=b
422 > http://localhost:$HGPORT1/bz2-b.hg BUNDLESPEC=bzip2-v2 extra=b
423 > EOF
423 > EOF
424
424
425 $ hg --config ui.clonebundleprefers=extra=b clone -U http://localhost:$HGPORT prefer-partially-defined-attribute
425 $ hg --config ui.clonebundleprefers=extra=b clone -U http://localhost:$HGPORT prefer-partially-defined-attribute
426 applying clone bundle from http://localhost:$HGPORT1/gz-b.hg
426 applying clone bundle from http://localhost:$HGPORT1/gz-b.hg
427 adding changesets
427 adding changesets
428 adding manifests
428 adding manifests
429 adding file changes
429 adding file changes
430 added 2 changesets with 2 changes to 2 files
430 added 2 changesets with 2 changes to 2 files
431 finished applying clone bundle
431 finished applying clone bundle
432 searching for changes
432 searching for changes
433 no changes found
433 no changes found
434
435 Test interaction between clone bundles and --uncompressed
436
437 A manifest with just a gzip bundle
438
439 $ cat > server/.hg/clonebundles.manifest << EOF
440 > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2
441 > EOF
442
443 $ hg clone -U --uncompressed http://localhost:$HGPORT uncompressed-gzip
444 streaming all changes
445 4 files to transfer, 613 bytes of data
446 transferred 613 bytes in * seconds (*) (glob)
447 searching for changes
448 no changes found
449
450 A manifest with a stream clone but no BUNDLESPEC
451
452 $ cat > server/.hg/clonebundles.manifest << EOF
453 > http://localhost:$HGPORT1/packed.hg
454 > EOF
455
456 $ hg clone -U --uncompressed http://localhost:$HGPORT uncompressed-no-bundlespec
457 streaming all changes
458 4 files to transfer, 613 bytes of data
459 transferred 613 bytes in * seconds (*) (glob)
460 searching for changes
461 no changes found
462
463 A manifest with a gzip bundle and a stream clone
464
465 $ cat > server/.hg/clonebundles.manifest << EOF
466 > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2
467 > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1
468 > EOF
469
470 $ hg clone -U --uncompressed http://localhost:$HGPORT uncompressed-gzip-packed
471 streaming all changes
472 4 files to transfer, 613 bytes of data
473 transferred 613 bytes in * seconds (*) (glob)
474 searching for changes
475 no changes found
476
477 A manifest with a gzip bundle and stream clone with supported requirements
478
479 $ cat > server/.hg/clonebundles.manifest << EOF
480 > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2
481 > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1;requirements%3Drevlogv1
482 > EOF
483
484 $ hg clone -U --uncompressed http://localhost:$HGPORT uncompressed-gzip-packed-requirements
485 streaming all changes
486 4 files to transfer, 613 bytes of data
487 transferred 613 bytes in * seconds (*) (glob)
488 searching for changes
489 no changes found
490
491 A manifest with a gzip bundle and a stream clone with unsupported requirements
492
493 $ cat > server/.hg/clonebundles.manifest << EOF
494 > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2
495 > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1;requirements%3Drevlogv42
496 > EOF
497
498 $ hg clone -U --uncompressed http://localhost:$HGPORT uncompressed-gzip-packed-unsupported-requirements
499 streaming all changes
500 4 files to transfer, 613 bytes of data
501 transferred 613 bytes in * seconds (*) (glob)
502 searching for changes
503 no changes found
General Comments 0
You need to be logged in to leave comments. Login now