diff tests/test-revlog-delta-find.t @ 51361:fa4c4fa232d6 stable

tests: make sha256line.py available for all tests This was previously only used in test-revlog-delta-find.t, but it will be useful (and used) in other tests that might need to generate poorly-compressible files.
author Anton Shestakov <av6@dwimlabs.net>
date Wed, 24 Jan 2024 13:35:30 -0300
parents 23b0999f6201
children
line wrap: on
line diff
--- a/tests/test-revlog-delta-find.t	Sun Jan 14 16:03:08 2024 -0300
+++ b/tests/test-revlog-delta-find.t	Wed Jan 24 13:35:30 2024 -0300
@@ -10,20 +10,13 @@
   > [debug]
   > revlog.debug-delta=yes
   > EOF
-  $ cat << EOF >> sha256line.py
-  > # a way to quickly produce file of significant size and poorly compressable content.
-  > import hashlib
-  > import sys
-  > for line in sys.stdin:
-  >     print(hashlib.sha256(line.encode('utf8')).hexdigest())
-  > EOF
 
   $ hg init base-repo
   $ cd base-repo
 
 create a "large" file
 
-  $ $TESTDIR/seq.py 1000 | $PYTHON $TESTTMP/sha256line.py > my-file.txt
+  $ $TESTDIR/seq.py 1000 | $TESTDIR/sha256line.py > my-file.txt
   $ hg add my-file.txt
   $ hg commit -m initial-commit
   DBG-DELTAS: FILELOG:my-file.txt: rev=0: delta-base=0 * (glob)
@@ -32,7 +25,7 @@
 
 Add more change at the end of the file
 
-  $ $TESTDIR/seq.py 1001 1200 | $PYTHON $TESTTMP/sha256line.py >> my-file.txt
+  $ $TESTDIR/seq.py 1001 1200 | $TESTDIR/sha256line.py >> my-file.txt
   $ hg commit -m "large-change"
   DBG-DELTAS: FILELOG:my-file.txt: rev=1: delta-base=0 * (glob)
   DBG-DELTAS: MANIFESTLOG: * (glob)
@@ -273,7 +266,7 @@
 
   $ hg -R peer-bad-delta-with-full update 'desc("merge")' --quiet
   $ ($TESTDIR/seq.py 2000 2100; $TESTDIR/seq.py 500 510; $TESTDIR/seq.py 3000 3050) \
-  > | $PYTHON $TESTTMP/sha256line.py > peer-bad-delta-with-full/my-file.txt
+  > | $TESTDIR/sha256line.py > peer-bad-delta-with-full/my-file.txt
   $ hg -R peer-bad-delta-with-full commit -m 'trigger-full'
   DBG-DELTAS: FILELOG:my-file.txt: rev=4: delta-base=4 * (glob)
   DBG-DELTAS: MANIFESTLOG: * (glob)