# HG changeset patch # User Anton Shestakov # Date 1631467895 -10800 # Node ID dd0ddc3dcb0f3fe8c0912d9e24fbc8b319b4f5ae # Parent 86c1d92d433f61646cef6c7e2ed8aae775ddb1fe tests: move editor.sh to $TESTTMP in test-split.t So that we don't need to recreate it inside every repo. diff -r 86c1d92d433f -r dd0ddc3dcb0f tests/test-split.t --- a/tests/test-split.t Fri Sep 10 16:25:52 2021 +0300 +++ b/tests/test-split.t Sun Sep 12 20:31:35 2021 +0300 @@ -21,7 +21,13 @@ > hg add "$1" > hg ci -m "add $1" $2 $3 > } - + $ cat > $TESTTMP/editor.sh << '__EOF__' + > NUM=$(cat num) + > NUM=`expr "$NUM" + 1` + > echo "$NUM" > num + > echo "split$NUM" > "$1" + > __EOF__ + $ export HGEDITOR="\"sh\" \"$TESTTMP/editor.sh\"" Basic case, split a head $ hg init testsplit @@ -37,13 +43,6 @@ To create commits with the number of split $ echo 0 > num - $ cat > editor.sh << '__EOF__' - > NUM=$(cat num) - > NUM=`expr "$NUM" + 1` - > echo "$NUM" > num - > echo "split$NUM" > "$1" - > __EOF__ - $ export HGEDITOR="\"sh\" \"editor.sh\"" $ hg split << EOF > y > y @@ -433,7 +432,7 @@ parent: 18:26f72cfaf036 tip Works on mytopic branch: new-branch:mytopic - commit: 2 unknown (clean) + commit: 1 unknown (clean) update: (current) phases: 9 draft topic: mytopic @@ -785,7 +784,6 @@ $ hg status ? SPLIT3 ? SPLIT4 - ? editor.sh ? num Test restricting the split to a subset of files @@ -1064,13 +1062,6 @@ To create commits with the number of split $ echo 0 > num - $ cat > editor.sh << '__EOF__' - > NUM=$(cat num) - > NUM=`expr "$NUM" + 1` - > echo "$NUM" > num - > echo "split$NUM" > "$1" - > __EOF__ - $ export HGEDITOR="\"sh\" \"editor.sh\"" Splitting the revision 1 to SPLIT1 and SPLIT2 which contains file a and b resp: $ hg split -r 1 < num - $ cat > editor.sh << '__EOF__' - > NUM=$(cat num) - > NUM=`expr "$NUM" + 1` - > echo "$NUM" > num - > echo "split$NUM" > "$1" - > __EOF__ - $ export HGEDITOR="\"sh\" \"editor.sh\"" Splitting $ hg split -r . << EOF @@ -1283,13 +1267,6 @@ $ cd discard-after-many $ echo 0 > num - $ cat > editor.sh << '__EOF__' - > NUM=$(cat num) - > NUM=`expr "$NUM" + 1` - > echo "$NUM" > num - > echo "split$NUM" > "$1" - > __EOF__ - $ export HGEDITOR="\"sh\" \"editor.sh\"" $ echo a > a $ echo b > b