##// END OF EJS Templates
bundle2: store changeset count when creating file bundles...
Gregory Szorc -
r29593:953839de default
parent child Browse files
Show More
@@ -1294,6 +1294,9 b' def writebundle(ui, cg, filename, bundle'
1294 1294 bundle.setcompression(compression)
1295 1295 part = bundle.newpart('changegroup', data=cg.getchunks())
1296 1296 part.addparam('version', cg.version)
1297 if 'clcount' in cg.extras:
1298 part.addparam('nbchanges', str(cg.extras['clcount']),
1299 mandatory=False)
1297 1300 chunkiter = bundle.getchunks()
1298 1301 else:
1299 1302 # compression argument is only for the bundle2 case
@@ -135,7 +135,7 b' class cg1unpacker(object):'
135 135 version = '01'
136 136 _grouplistcount = 1 # One list of files after the manifests
137 137
138 def __init__(self, fh, alg):
138 def __init__(self, fh, alg, extras=None):
139 139 if alg == 'UN':
140 140 alg = None # get more modern without breaking too much
141 141 if not alg in util.decompressors:
@@ -145,6 +145,7 b' class cg1unpacker(object):'
145 145 alg = '_truncatedBZ'
146 146 self._stream = util.decompressors[alg](fh)
147 147 self._type = alg
148 self.extras = extras or {}
148 149 self.callback = None
149 150
150 151 # These methods (compressed, read, seek, tell) all appear to only
@@ -900,8 +901,8 b' def getbundler(version, repo, bundlecaps'
900 901 assert version in supportedoutgoingversions(repo)
901 902 return _packermap[version][0](repo, bundlecaps)
902 903
903 def getunbundler(version, fh, alg):
904 return _packermap[version][1](fh, alg)
904 def getunbundler(version, fh, alg, extras=None):
905 return _packermap[version][1](fh, alg, extras=extras)
905 906
906 907 def _changegroupinfo(repo, nodes, source):
907 908 if repo.ui.verbose or source == 'bundle':
@@ -929,7 +930,8 b' def getsubsetraw(repo, outgoing, bundler'
929 930
930 931 def getsubset(repo, outgoing, bundler, source, fastpath=False):
931 932 gengroup = getsubsetraw(repo, outgoing, bundler, source, fastpath)
932 return getunbundler(bundler.version, util.chunkbuffer(gengroup), None)
933 return getunbundler(bundler.version, util.chunkbuffer(gengroup), None,
934 {'clcount': len(outgoing.missing)})
933 935
934 936 def changegroupsubset(repo, roots, heads, source, version='01'):
935 937 """Compute a changegroup consisting of all the nodes that are
@@ -52,7 +52,7 b' test bundle types'
52 52 1 changesets found
53 53 HG20\x00\x00 (esc)
54 54 Stream params: {}
55 changegroup -- "sortdict([('version', '02')])"
55 changegroup -- "sortdict([('version', '02'), ('nbchanges', '1')])"
56 56 c35a0f9217e65d1fdb90c936ffa7dbe679f83ddf
57 57 none-v2
58 58
@@ -61,7 +61,7 b' test bundle types'
61 61 1 changesets found
62 62 HG20\x00\x00 (esc)
63 63 Stream params: sortdict([('Compression', 'BZ')])
64 changegroup -- "sortdict([('version', '02')])"
64 changegroup -- "sortdict([('version', '02'), ('nbchanges', '1')])"
65 65 c35a0f9217e65d1fdb90c936ffa7dbe679f83ddf
66 66 bzip2-v2
67 67
@@ -70,7 +70,7 b' test bundle types'
70 70 1 changesets found
71 71 HG20\x00\x00 (esc)
72 72 Stream params: sortdict([('Compression', 'GZ')])
73 changegroup -- "sortdict([('version', '02')])"
73 changegroup -- "sortdict([('version', '02'), ('nbchanges', '1')])"
74 74 c35a0f9217e65d1fdb90c936ffa7dbe679f83ddf
75 75 gzip-v2
76 76
@@ -79,7 +79,7 b' test bundle types'
79 79 1 changesets found
80 80 HG20\x00\x00 (esc)
81 81 Stream params: {}
82 changegroup -- "sortdict([('version', '02')])"
82 changegroup -- "sortdict([('version', '02'), ('nbchanges', '1')])"
83 83 c35a0f9217e65d1fdb90c936ffa7dbe679f83ddf
84 84 none-v2
85 85
@@ -88,7 +88,7 b' test bundle types'
88 88 1 changesets found
89 89 HG20\x00\x00 (esc)
90 90 Stream params: sortdict([('Compression', 'BZ')])
91 changegroup -- "sortdict([('version', '02')])"
91 changegroup -- "sortdict([('version', '02'), ('nbchanges', '1')])"
92 92 c35a0f9217e65d1fdb90c936ffa7dbe679f83ddf
93 93 bzip2-v2
94 94
@@ -708,7 +708,7 b' bundle single branch'
708 708 1a38c1b849e8b70c756d2d80b0b9a3ac0b7ea11a
709 709 057f4db07f61970e1c11e83be79e9d08adc4dc31
710 710 bundle2-output-bundle: "HG20", (1 params) 1 parts total
711 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
711 bundle2-output-part: "changegroup" (params: 1 mandatory 1 advisory) streamed payload
712 712 bundling: 1/2 changesets (50.00%)
713 713 bundling: 2/2 changesets (100.00%)
714 714 bundling: 1/2 manifests (50.00%)
@@ -156,33 +156,34 b' changes, clone bundles produced by new M'
156 156 by old clients.
157 157
158 158 $ f --size --hexdump full.hg
159 full.hg: size=406
159 full.hg: size=418
160 160 0000: 48 47 32 30 00 00 00 0e 43 6f 6d 70 72 65 73 73 |HG20....Compress|
161 0010: 69 6f 6e 3d 47 5a 78 9c 63 60 60 90 e5 76 f6 70 |ion=GZx.c``..v.p|
162 0020: f4 73 77 75 0f f2 0f 0d 60 00 02 46 06 76 a6 b2 |.swu....`..F.v..|
163 0030: d4 a2 e2 cc fc 3c 03 23 06 06 e6 65 40 b1 4d c1 |.....<.#...e@.M.|
164 0040: 2a 31 09 cf 9a 3a 52 04 b7 fc db f0 95 e5 a4 f4 |*1...:R.........|
165 0050: 97 17 b2 c9 0c 14 00 02 e6 d9 99 25 1a a7 a4 99 |...........%....|
166 0060: a4 a4 1a 5b 58 a4 19 27 9b a4 59 a4 1a 59 a4 99 |...[X..'..Y..Y..|
167 0070: a4 59 26 5a 18 9a 18 59 5a 26 1a 27 27 25 99 a6 |.Y&Z...YZ&.''%..|
168 0080: 99 1a 70 95 a4 16 97 70 19 28 18 70 a5 e5 e7 73 |..p....p.(.p...s|
169 0090: 71 25 a6 a4 28 00 19 40 13 0e ac fa df ab ff 7b |q%..(..@.......{|
170 00a0: 3f fb 92 dc 8b 1f 62 bb 9e b7 d7 d9 87 3d 5a 44 |?.....b......=ZD|
171 00b0: ac 2f b0 a9 c3 66 1e 54 b9 26 08 a7 1a 1b 1a a7 |./...f.T.&......|
172 00c0: 25 1b 9a 1b 99 19 9a 5a 18 9b a6 18 19 00 dd 67 |%......Z.......g|
173 00d0: 61 61 98 06 f4 80 49 4a 8a 65 52 92 41 9a 81 81 |aa....IJ.eR.A...|
174 00e0: a5 11 17 50 31 30 58 19 cc 80 98 25 29 b1 08 c4 |...P10X....%)...|
175 00f0: 37 07 79 19 88 d9 41 ee 07 8a 41 cd 5d 98 65 fb |7.y...A...A.].e.|
176 0100: e5 9e 45 bf 8d 7f 9f c6 97 9f 2b 44 34 67 d9 ec |..E.......+D4g..|
177 0110: 8e 0f a0 61 a8 eb 82 82 2e c9 c2 20 25 d5 34 c5 |...a....... %.4.|
178 0120: d0 d8 c2 dc d4 c2 d4 c4 30 d9 34 cd c0 d4 c8 cc |........0.4.....|
179 0130: 34 31 c5 d0 c4 24 31 c9 32 2d d1 c2 2c c5 30 25 |41...$1.2-..,.0%|
180 0140: 09 e4 ee 85 8f 85 ff 88 ab 89 36 c7 2a c4 47 34 |..........6.*.G4|
181 0150: fe f8 ec 7b 73 37 3f c3 24 62 1d 8d 4d 1d 9e 40 |...{s7?.$b..M..@|
182 0160: 06 3b 10 14 36 a4 38 10 04 d8 21 01 9a b1 83 f7 |.;..6.8...!.....|
183 0170: e9 45 8b d2 56 c7 a3 1f 82 52 d7 8a 78 ed fc d5 |.E..V....R..x...|
184 0180: 76 f1 36 25 81 89 c7 ad ec 90 34 48 75 2b 89 49 |v.6%......4Hu+.I|
185 0190: bf 00 d6 97 f0 8d |......|
161 0010: 69 6f 6e 3d 47 5a 78 9c 63 60 60 d0 e4 76 f6 70 |ion=GZx.c``..v.p|
162 0020: f4 73 77 75 0f f2 0f 0d 60 00 02 46 46 76 26 4e |.swu....`..FFv&N|
163 0030: c6 b2 d4 a2 e2 cc fc 3c 03 a3 bc a4 e4 8c c4 bc |.......<........|
164 0040: f4 d4 62 23 06 06 e6 65 40 f9 4d c1 2a 31 09 cf |..b#...e@.M.*1..|
165 0050: 9a 3a 52 04 b7 fc db f0 95 e5 a4 f4 97 17 b2 c9 |.:R.............|
166 0060: 0c 14 00 02 e6 d9 99 25 1a a7 a4 99 a4 a4 1a 5b |.......%.......[|
167 0070: 58 a4 19 27 9b a4 59 a4 1a 59 a4 99 a4 59 26 5a |X..'..Y..Y...Y&Z|
168 0080: 18 9a 18 59 5a 26 1a 27 27 25 99 a6 99 1a 70 95 |...YZ&.''%....p.|
169 0090: a4 16 97 70 19 28 18 70 a5 e5 e7 73 71 25 a6 a4 |...p.(.p...sq%..|
170 00a0: 28 00 19 40 13 0e ac fa df ab ff 7b 3f fb 92 dc |(..@.......{?...|
171 00b0: 8b 1f 62 bb 9e b7 d7 d9 87 3d 5a 44 ac 2f b0 a9 |..b......=ZD./..|
172 00c0: c3 66 1e 54 b9 26 08 a7 1a 1b 1a a7 25 1b 9a 1b |.f.T.&......%...|
173 00d0: 99 19 9a 5a 18 9b a6 18 19 00 dd 67 61 61 98 06 |...Z.......gaa..|
174 00e0: f4 80 49 4a 8a 65 52 92 41 9a 81 81 a5 11 17 50 |..IJ.eR.A......P|
175 00f0: 31 30 58 19 cc 80 98 25 29 b1 08 c4 37 07 79 19 |10X....%)...7.y.|
176 0100: 88 d9 41 ee 07 8a 41 cd 5d 98 65 fb e5 9e 45 bf |..A...A.].e...E.|
177 0110: 8d 7f 9f c6 97 9f 2b 44 34 67 d9 ec 8e 0f a0 61 |......+D4g.....a|
178 0120: a8 eb 82 82 2e c9 c2 20 25 d5 34 c5 d0 d8 c2 dc |....... %.4.....|
179 0130: d4 c2 d4 c4 30 d9 34 cd c0 d4 c8 cc 34 31 c5 d0 |....0.4.....41..|
180 0140: c4 24 31 c9 32 2d d1 c2 2c c5 30 25 09 e4 ee 85 |.$1.2-..,.0%....|
181 0150: 8f 85 ff 88 ab 89 36 c7 2a c4 47 34 fe f8 ec 7b |......6.*.G4...{|
182 0160: 73 37 3f c3 24 62 1d 8d 4d 1d 9e 40 06 3b 10 14 |s7?.$b..M..@.;..|
183 0170: 36 a4 38 10 04 d8 21 01 9a b1 83 f7 e9 45 8b d2 |6.8...!......E..|
184 0180: 56 c7 a3 1f 82 52 d7 8a 78 ed fc d5 76 f1 36 25 |V....R..x...v.6%|
185 0190: 81 89 c7 ad ec 90 34 48 75 2b 89 49 bf 00 cf 72 |......4Hu+.I...r|
186 01a0: f4 7f |..|
186 187
187 188 $ echo "http://localhost:$HGPORT1/full.hg" > server/.hg/clonebundles.manifest
188 189 $ hg clone -U http://localhost:$HGPORT full-bundle
@@ -31,7 +31,7 b' Terse output:'
31 31
32 32 $ hg debugbundle bundle2.hg
33 33 Stream params: {}
34 changegroup -- "sortdict([('version', '02')])"
34 changegroup -- "sortdict([('version', '02'), ('nbchanges', '2')])"
35 35 0e067c57feba1a5694ca4844f05588bb1bf82342
36 36 991a3460af53952d10ec8a295d3d2cc2e5fa9690
37 37
@@ -56,7 +56,7 b' Verbose output:'
56 56
57 57 $ hg debugbundle --all bundle2.hg
58 58 Stream params: {}
59 changegroup -- "sortdict([('version', '02')])"
59 changegroup -- "sortdict([('version', '02'), ('nbchanges', '2')])"
60 60 format: id, p1, p2, cset, delta base, len(delta)
61 61
62 62 changelog
@@ -155,7 +155,7 b' Test that strip bundle use bundle2'
155 155 saved backup bundle to $TESTTMP/aggressive/.hg/strip-backup/1c5d4dc9a8b8-6c68e60c-backup.hg (glob)
156 156 $ hg debugbundle .hg/strip-backup/*
157 157 Stream params: sortdict([('Compression', 'BZ')])
158 changegroup -- "sortdict([('version', '02')])"
158 changegroup -- "sortdict([('version', '02'), ('nbchanges', '1')])"
159 159 1c5d4dc9a8b8d6e1750966d343e94db665e7a1e9
160 160
161 161 $ cd ..
@@ -170,7 +170,7 b' Get branch and merge:'
170 170 $ hg debuggetbundle repo bundle -t bundle2
171 171 $ hg debugbundle bundle
172 172 Stream params: {}
173 changegroup -- "sortdict([('version', '01')])"
173 changegroup -- "sortdict([('version', '01'), ('nbchanges', '18')])"
174 174 7704483d56b2a7b5db54dcee7c62378ac629b348
175 175 29a4d1f17bd3f0779ca0525bebb1cfb51067c738
176 176 713346a995c363120712aed1aee7e04afd867638
@@ -352,14 +352,14 b' test bundle and description:'
352 352 Content-Disposition: attachment; filename="bundle.hg"
353 353 Content-Transfer-Encoding: base64
354 354
355 SEcyMAAAAA5Db21wcmVzc2lvbj1CWkJaaDkxQVkmU1lCZFwPAAAKf//7nFYSWD1/4H7R09C/I70I
356 Ak0E4peoSIYIgQCgGUQOcLABGY2hqoAAAaBMTTAAAahgTCZoAAAAAMQaqn5GmapojQ00DEGI/VGJ
357 kDAJoGTDUAAyM0QaAEqalPTUaMhoyDIDR6IxAGEGmgAehMRhDRsoyB6TYTC8JyLN+jTGqitRAgRJ
358 b3SRlhd8/+VxlAUqAilLoKPEEyxFQkaEGo+DzItFeNiFAo8NMMweVtvXJFIMhjoKC18DeYwjLKBz
359 wrMcs86qJrctDNJorwBMuLcqvTVWHh1IlsIaaaYSUIP2IZsogT1+pSSZS+bSTJrgfKsO9go/f0HF
360 uW4Yr2vXpxDreOgSIAdK/xC8Yay48SLpxIuqc/BZ6rVZCgG21rr0zhCaEgXOTqNaYEvANvg0B0Qo
361 dgtqAs1FDcZgzYitwJh6ZAG0C4mA7FPrp9b7h0h/A44Xgd+0it1gvF0mFE/CCPwymXS+OisOOCAF
362 mDUDAC1pBvsXckU4UJBCZFwP
355 SEcyMAAAAA5Db21wcmVzc2lvbj1CWkJaaDkxQVkmU1kIqE7KAAAKf//7vFYQWD1/4H7R09C/470I
356 Ak0E4peoSIYIgQCgGUQOcLABGY2hqoTTCYaBqaYAAACaaMAATIwAA1MIYDaQaqn6p+jRop+oJkA2
357 oNqD1PU0PUBoxqaMmjMUepoBoDT1GmQNBKmlTT1GTCNMEAYTQ0NNDI0BoMQHpAZAA8o2pkyNJHfX
358 RRbXoyxKRUlAg41B3lpmMOnr77dEpFKAvEUGEkWuC4wioiMjC2Y2a84EXhsNCFIrbXUGId07PJnS
359 ELAOIpL/gE8R8CUeXuw2NKMtkFoLPkcTSomXtgHSg1IKaCNlWwVU3CpmMYqh5gkFYJKOD4UhVVQ6
360 SiF1DpE8ghWvF1ih+fYgagfYHI96w/QsrRATpYiP7VRbINFrQy2c21mZ7M4pXXrPBypoXAIhtum7
361 aKDJCpUqMDF5dfiDChMfgH9nQ4B60Uvgb4AK9dsbSYc+O3tEyNq9g9gZeA5Je2T82GzjC4DbY4F2
362 0kdrTBwslErFshCgDzeEBwICg13oQaQawQA1WWd3F3JFOFCQCKhOyg==
363 363 --===============*==-- (glob)
364 364
365 365 with a specific bundle type
@@ -279,7 +279,7 b' Check that the right ancestors is used w'
279 279 e31216eec445e44352c5f01588856059466a24c9
280 280 2f2496ddf49d69b5ef23ad8cf9fb2e0e4faf0ac2
281 281 bundle2-output-bundle: "HG20", (1 params) 1 parts total
282 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
282 bundle2-output-part: "changegroup" (params: 1 mandatory 1 advisory) streamed payload
283 283 saved backup bundle to $TESTTMP/issue4041/.hg/strip-backup/e31216eec445-15f7a814-backup.hg (glob)
284 284 3 changesets found
285 285 list of changesets:
@@ -287,10 +287,10 b' Check that the right ancestors is used w'
287 287 19c888675e133ab5dff84516926a65672eaf04d9
288 288 2a7f09cac94c7f4b73ebd5cd1a62d3b2e8e336bf
289 289 bundle2-output-bundle: "HG20", 1 parts total
290 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
290 bundle2-output-part: "changegroup" (params: 1 mandatory 1 advisory) streamed payload
291 291 adding branch
292 292 bundle2-input-bundle: with-transaction
293 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
293 bundle2-input-part: "changegroup" (params: 1 mandatory 1 advisory) supported
294 294 adding changesets
295 295 add changeset 4c9fbe56a16f
296 296 add changeset 19c888675e13
@@ -1045,7 +1045,7 b' with general delta'
1045 1045 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1046 1046 $ hg debugbundle .hg/shelved/*.hg
1047 1047 Stream params: sortdict([('Compression', 'BZ')])
1048 changegroup -- "sortdict([('version', '02')])"
1048 changegroup -- "sortdict([('version', '02'), ('nbchanges', '1')])"
1049 1049 45993d65fe9dc3c6d8764b9c3b07fa831ee7d92d
1050 1050 $ cd ..
1051 1051
@@ -211,7 +211,7 b''
211 211
212 212 $ hg debugbundle .hg/strip-backup/*
213 213 Stream params: sortdict([('Compression', 'BZ')])
214 changegroup -- "sortdict([('version', '02')])"
214 changegroup -- "sortdict([('version', '02'), ('nbchanges', '1')])"
215 215 264128213d290d868c54642d13aeaa3675551a78
216 216 $ hg pull .hg/strip-backup/*
217 217 pulling from .hg/strip-backup/264128213d29-0b39d6bf-backup.hg
@@ -799,7 +799,7 b' check strip behavior'
799 799 6625a516847449b6f0fa3737b9ba56e9f0f3032c
800 800 d8db9d1372214336d2b5570f20ee468d2c72fa8b
801 801 bundle2-output-bundle: "HG20", (1 params) 1 parts total
802 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
802 bundle2-output-part: "changegroup" (params: 1 mandatory 1 advisory) streamed payload
803 803 saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/6625a5168474-345bb43d-backup.hg (glob)
804 804 invalid branchheads cache (served): tip differs
805 805 truncating cache/rbc-revs-v1 to 24
General Comments 0
You need to be logged in to leave comments. Login now