##// END OF EJS Templates
tests: make sha256line.py available for all tests...
av6 -
r52254:fa4c4fa2 stable
parent child Browse files
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 10 > [debug]
11 11 > revlog.debug-delta=yes
12 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 14 $ hg init base-repo
22 15 $ cd base-repo
23 16
24 17 create a "large" file
25 18
26 $ $TESTDIR/seq.py 1000 | $PYTHON $TESTTMP/sha256line.py > my-file.txt
19 $ $TESTDIR/seq.py 1000 | $TESTDIR/sha256line.py > my-file.txt
27 20 $ hg add my-file.txt
28 21 $ hg commit -m initial-commit
29 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 26 Add more change at the end of the file
34 27
35 $ $TESTDIR/seq.py 1001 1200 | $PYTHON $TESTTMP/sha256line.py >> my-file.txt
28 $ $TESTDIR/seq.py 1001 1200 | $TESTDIR/sha256line.py >> my-file.txt
36 29 $ hg commit -m "large-change"
37 30 DBG-DELTAS: FILELOG:my-file.txt: rev=1: delta-base=0 * (glob)
38 31 DBG-DELTAS: MANIFESTLOG: * (glob)
@@ -273,7 +266,7 b' We build a very different file content t'
273 266
274 267 $ hg -R peer-bad-delta-with-full update 'desc("merge")' --quiet
275 268 $ ($TESTDIR/seq.py 2000 2100; $TESTDIR/seq.py 500 510; $TESTDIR/seq.py 3000 3050) \
276 > | $PYTHON $TESTTMP/sha256line.py > peer-bad-delta-with-full/my-file.txt
269 > | $TESTDIR/sha256line.py > peer-bad-delta-with-full/my-file.txt
277 270 $ hg -R peer-bad-delta-with-full commit -m 'trigger-full'
278 271 DBG-DELTAS: FILELOG:my-file.txt: rev=4: delta-base=4 * (glob)
279 272 DBG-DELTAS: MANIFESTLOG: * (glob)
General Comments 0
You need to be logged in to leave comments. Login now