comparison tests/test-fix-topology.t @ 37560:41ba336d9f1e

fix: use a portable python script instead of sed in test Differential Revision: https://phab.mercurial-scm.org/D2988
author Danny Hooper <hooper@google.com>
date Fri, 30 Mar 2018 17:01:12 -0700
parents ded5ea279a93
children e2506748b47f
comparison
equal deleted inserted replaced
37559:c4a0626f6b6e 37560:41ba336d9f1e
1 A script that implements uppercasing all letters in a file.
2
3 $ UPPERCASEPY="$TESTTMP/uppercase.py"
4 $ cat > $UPPERCASEPY <<EOF
5 > import sys
6 > from mercurial.utils.procutil import setbinary
7 > setbinary(sys.stdin)
8 > setbinary(sys.stdout)
9 > sys.stdout.write(sys.stdin.read().upper())
10 > EOF
11 $ TESTLINES="foo\nbar\nbaz\n"
12 $ printf $TESTLINES | $PYTHON $UPPERCASEPY
13 FOO
14 BAR
15 BAZ
16
1 Tests for the fix extension's behavior around non-trivial history topologies. 17 Tests for the fix extension's behavior around non-trivial history topologies.
2 Looks for correct incremental fixing and reproduction of parent/child 18 Looks for correct incremental fixing and reproduction of parent/child
3 relationships. We indicate fixed file content by uppercasing it. 19 relationships. We indicate fixed file content by uppercasing it.
4 20
5 $ cat >> $HGRCPATH <<EOF 21 $ cat >> $HGRCPATH <<EOF
6 > [extensions] 22 > [extensions]
7 > fix = 23 > fix =
8 > [fix] 24 > [fix]
9 > uppercase-whole-file:command=sed -e 's/.*/\U&/' 25 > uppercase-whole-file:command=$PYTHON $UPPERCASEPY
10 > uppercase-whole-file:fileset=set:** 26 > uppercase-whole-file:fileset=set:**
11 > EOF 27 > EOF
12 28
13 This tests the only behavior that should really be affected by obsolescence, so 29 This tests the only behavior that should really be affected by obsolescence, so
14 we'll test it with evolution off and on. This only changes the revision 30 we'll test it with evolution off and on. This only changes the revision