comparison tests/test-strip.t @ 29593:953839de96ab

bundle2: store changeset count when creating file bundles The bundle2 changegroup part has an advisory param saying how many changesets are in the part. Before this patch, we were setting this part when generating bundle2 parts via the wire protocol but not when generating local bundle2 files. A side effect of not setting the changeset count part is that progress bars don't work when applying changesets. As the tests show, this impacted clone bundles, shelve, backup bundles, `hg unbundle`, and anything touching bundle2 files. This patch adds a backdoor to allow us to pass state from changegroup generation into the unbundler. We store the number of changesets in the changegroup in this state and use it to populate the aforementioned advisory part parameter when generating the bundle2 bundle. I concede that I'm not thrilled by how state is being passed in changegroup.py (it feels a bit hacky). I would love to overhaul the rather confusing set of functions in changegroup.py with something that passes rich objects around instead of e.g. low-level generators. However, given the code freeze for 3.9 is imminent, I'd rather not undertake this endeavor right now. This feels like the easiest way to get the parameter added to the changegroup part.
author Gregory Szorc <gregory.szorc@gmail.com>
date Sun, 17 Jul 2016 15:13:51 -0700
parents 37cccad55410
children 44ef21621ad7
comparison
equal deleted inserted replaced
29592:37cccad55410 29593:953839de96ab
209 date: Thu Jan 01 00:00:00 1970 +0000 209 date: Thu Jan 01 00:00:00 1970 +0000
210 summary: b 210 summary: b
211 211
212 $ hg debugbundle .hg/strip-backup/* 212 $ hg debugbundle .hg/strip-backup/*
213 Stream params: sortdict([('Compression', 'BZ')]) 213 Stream params: sortdict([('Compression', 'BZ')])
214 changegroup -- "sortdict([('version', '02')])" 214 changegroup -- "sortdict([('version', '02'), ('nbchanges', '1')])"
215 264128213d290d868c54642d13aeaa3675551a78 215 264128213d290d868c54642d13aeaa3675551a78
216 $ hg pull .hg/strip-backup/* 216 $ hg pull .hg/strip-backup/*
217 pulling from .hg/strip-backup/264128213d29-0b39d6bf-backup.hg 217 pulling from .hg/strip-backup/264128213d29-0b39d6bf-backup.hg
218 searching for changes 218 searching for changes
219 adding changesets 219 adding changesets
797 2 changesets found 797 2 changesets found
798 list of changesets: 798 list of changesets:
799 6625a516847449b6f0fa3737b9ba56e9f0f3032c 799 6625a516847449b6f0fa3737b9ba56e9f0f3032c
800 d8db9d1372214336d2b5570f20ee468d2c72fa8b 800 d8db9d1372214336d2b5570f20ee468d2c72fa8b
801 bundle2-output-bundle: "HG20", (1 params) 1 parts total 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 saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/6625a5168474-345bb43d-backup.hg (glob) 803 saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/6625a5168474-345bb43d-backup.hg (glob)
804 invalid branchheads cache (served): tip differs 804 invalid branchheads cache (served): tip differs
805 truncating cache/rbc-revs-v1 to 24 805 truncating cache/rbc-revs-v1 to 24
806 $ hg log -G 806 $ hg log -G
807 o changeset: 2:5c51d8d6557d 807 o changeset: 2:5c51d8d6557d