Show More
@@ -0,0 +1,14 b'' | |||||
|
1 | #!/usr/bin/env python3 | |||
|
2 | # | |||
|
3 | # A tool to help producing large and poorly compressible files | |||
|
4 | # | |||
|
5 | # Usage: | |||
|
6 | # $TESTDIR/seq.py 1000 | $TESTDIR/sha256line.py > my-file.txt | |||
|
7 | ||||
|
8 | ||||
|
9 | import hashlib | |||
|
10 | import sys | |||
|
11 | ||||
|
12 | ||||
|
13 | for line in sys.stdin: | |||
|
14 | print(hashlib.sha256(line.encode('utf8')).hexdigest()) |
@@ -10,20 +10,13 b' basic setup' | |||||
10 | > [debug] |
|
10 | > [debug] | |
11 | > revlog.debug-delta=yes |
|
11 | > revlog.debug-delta=yes | |
12 | > EOF |
|
12 | > EOF | |
13 | $ cat << EOF >> sha256line.py |
|
|||
14 | > # a way to quickly produce file of significant size and poorly compressable content. |
|
|||
15 | > import hashlib |
|
|||
16 | > import sys |
|
|||
17 | > for line in sys.stdin: |
|
|||
18 | > print(hashlib.sha256(line.encode('utf8')).hexdigest()) |
|
|||
19 | > EOF |
|
|||
20 |
|
13 | |||
21 | $ hg init base-repo |
|
14 | $ hg init base-repo | |
22 | $ cd base-repo |
|
15 | $ cd base-repo | |
23 |
|
16 | |||
24 | create a "large" file |
|
17 | create a "large" file | |
25 |
|
18 | |||
26 |
$ $TESTDIR/seq.py 1000 | $ |
|
19 | $ $TESTDIR/seq.py 1000 | $TESTDIR/sha256line.py > my-file.txt | |
27 | $ hg add my-file.txt |
|
20 | $ hg add my-file.txt | |
28 | $ hg commit -m initial-commit |
|
21 | $ hg commit -m initial-commit | |
29 | DBG-DELTAS: FILELOG:my-file.txt: rev=0: delta-base=0 * (glob) |
|
22 | DBG-DELTAS: FILELOG:my-file.txt: rev=0: delta-base=0 * (glob) | |
@@ -32,7 +25,7 b' create a "large" file' | |||||
32 |
|
25 | |||
33 | Add more change at the end of the file |
|
26 | Add more change at the end of the file | |
34 |
|
27 | |||
35 |
$ $TESTDIR/seq.py 1001 1200 | $ |
|
28 | $ $TESTDIR/seq.py 1001 1200 | $TESTDIR/sha256line.py >> my-file.txt | |
36 | $ hg commit -m "large-change" |
|
29 | $ hg commit -m "large-change" | |
37 | DBG-DELTAS: FILELOG:my-file.txt: rev=1: delta-base=0 * (glob) |
|
30 | DBG-DELTAS: FILELOG:my-file.txt: rev=1: delta-base=0 * (glob) | |
38 | DBG-DELTAS: MANIFESTLOG: * (glob) |
|
31 | DBG-DELTAS: MANIFESTLOG: * (glob) | |
@@ -273,7 +266,7 b' We build a very different file content t' | |||||
273 |
|
266 | |||
274 | $ hg -R peer-bad-delta-with-full update 'desc("merge")' --quiet |
|
267 | $ hg -R peer-bad-delta-with-full update 'desc("merge")' --quiet | |
275 | $ ($TESTDIR/seq.py 2000 2100; $TESTDIR/seq.py 500 510; $TESTDIR/seq.py 3000 3050) \ |
|
268 | $ ($TESTDIR/seq.py 2000 2100; $TESTDIR/seq.py 500 510; $TESTDIR/seq.py 3000 3050) \ | |
276 |
> | $ |
|
269 | > | $TESTDIR/sha256line.py > peer-bad-delta-with-full/my-file.txt | |
277 | $ hg -R peer-bad-delta-with-full commit -m 'trigger-full' |
|
270 | $ hg -R peer-bad-delta-with-full commit -m 'trigger-full' | |
278 | DBG-DELTAS: FILELOG:my-file.txt: rev=4: delta-base=4 * (glob) |
|
271 | DBG-DELTAS: FILELOG:my-file.txt: rev=4: delta-base=4 * (glob) | |
279 | DBG-DELTAS: MANIFESTLOG: * (glob) |
|
272 | DBG-DELTAS: MANIFESTLOG: * (glob) |
General Comments 0
You need to be logged in to leave comments.
Login now