Show More
@@ -600,6 +600,7 b' def debugdeltachain(ui, repo, file_=None' | |||
|
600 | 600 | (sum of the sizes of all the blocks) |
|
601 | 601 | :``largestblock``: size of the largest block of data read from the disk |
|
602 | 602 | :``readdensity``: density of useful bytes in the data read from the disk |
|
603 | :``srchunks``: in how many data hunks the whole revision would be read | |
|
603 | 604 | |
|
604 | 605 | The sparse read can be enabled with experimental.sparse-read = True |
|
605 | 606 | """ |
@@ -645,7 +646,7 b' def debugdeltachain(ui, repo, file_=None' | |||
|
645 | 646 | 'size rawsize chainsize ratio lindist extradist ' |
|
646 | 647 | 'extraratio') |
|
647 | 648 | if withsparseread: |
|
648 | fm.plain(' readsize largestblk rddensity') | |
|
649 | fm.plain(' readsize largestblk rddensity srchunks') | |
|
649 | 650 | fm.plain('\n') |
|
650 | 651 | |
|
651 | 652 | chainbases = {} |
@@ -693,11 +694,17 b' def debugdeltachain(ui, repo, file_=None' | |||
|
693 | 694 | |
|
694 | 695 | readdensity = float(chainsize) / float(readsize) |
|
695 | 696 | |
|
696 | fm.write('readsize largestblock readdensity', | |
|
697 | ' %10d %10d %9.5f', | |
|
698 | readsize, largestblock, readdensity, | |
|
697 | if util.safehasattr(revlog, '_slicechunk'): | |
|
698 | revchunks = tuple(revlog._slicechunk(r, chain)) | |
|
699 | else: | |
|
700 | revchunks = (chain,) | |
|
701 | srchunks = len(revchunks) | |
|
702 | ||
|
703 | fm.write('readsize largestblock readdensity srchunks', | |
|
704 | ' %10d %10d %9.5f %8d', | |
|
705 | readsize, largestblock, readdensity, srchunks, | |
|
699 | 706 | readsize=readsize, largestblock=largestblock, |
|
700 | readdensity=readdensity) | |
|
707 | readdensity=readdensity, srchunks=srchunks) | |
|
701 | 708 | |
|
702 | 709 | fm.plain('\n') |
|
703 | 710 |
@@ -86,8 +86,8 b' debugdelta chain with sparse read enable' | |||
|
86 | 86 | > sparse-read = True |
|
87 | 87 | > EOF |
|
88 | 88 | $ hg debugdeltachain -m |
|
89 | rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity | |
|
90 | 0 1 1 -1 base 44 43 44 1.02326 44 0 0.00000 44 44 1.00000 | |
|
89 | rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks | |
|
90 | 0 1 1 -1 base 44 43 44 1.02326 44 0 0.00000 44 44 1.00000 1 | |
|
91 | 91 | |
|
92 | 92 | $ hg debugdeltachain -m -T '{rev} {chainid} {chainlen} {readsize} {largestblock} {readdensity}\n' |
|
93 | 93 | 0 1 1 44 44 1.0 |
@@ -109,10 +109,42 b' debugdelta chain with sparse read enable' | |||
|
109 | 109 | "readdensity": 1.0, |
|
110 | 110 | "readsize": 44, |
|
111 | 111 | "rev": 0, |
|
112 | "srchunks": 1, | |
|
112 | 113 | "uncompsize": 43 |
|
113 | 114 | } |
|
114 | 115 | ] |
|
115 | 116 | |
|
117 | $ printf "This test checks things.\n" >> a | |
|
118 | $ hg ci -m a | |
|
119 | $ hg branch other | |
|
120 | marked working directory as branch other | |
|
121 | (branches are permanent and global, did you want a bookmark?) | |
|
122 | $ for i in `$TESTDIR/seq.py 5`; do | |
|
123 | > printf "shorter ${i}" >> a | |
|
124 | > hg ci -m "a other:$i" | |
|
125 | > hg up -q default | |
|
126 | > printf "for the branch default we want longer chains: ${i}" >> a | |
|
127 | > hg ci -m "a default:$i" | |
|
128 | > hg up -q other | |
|
129 | > done | |
|
130 | $ hg debugdeltachain a -T '{rev} {srchunks}\n' \ | |
|
131 | > --config experimental.sparse-read.density-threshold=0.50 \ | |
|
132 | > --config experimental.sparse-read.min-gap-size=0 | |
|
133 | 0 1 | |
|
134 | 1 1 | |
|
135 | 2 1 | |
|
136 | 3 1 | |
|
137 | 4 1 | |
|
138 | 5 1 | |
|
139 | 6 1 | |
|
140 | 7 1 | |
|
141 | 8 1 | |
|
142 | 9 1 | |
|
143 | 10 2 | |
|
144 | 11 1 | |
|
145 | $ hg --config extensions.strip= strip --no-backup -r 1 | |
|
146 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
147 | ||
|
116 | 148 | Test max chain len |
|
117 | 149 | $ cat >> $HGRCPATH << EOF |
|
118 | 150 | > [format] |
General Comments 0
You need to be logged in to leave comments.
Login now