changeset 6037:dd0ddc3dcb0f

tests: move editor.sh to $TESTTMP in test-split.t So that we don't need to recreate it inside every repo.
author Anton Shestakov <av6@dwimlabs.net>
date Sun, 12 Sep 2021 20:31:35 +0300
parents 86c1d92d433f
children af2fec9b541c
files tests/test-split.t
diffstat 1 files changed, 8 insertions(+), 31 deletions(-) [+]
line wrap: on
line diff
--- 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 <<EOF
@@ -1213,13 +1204,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
   $ 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