comparison tests/test-record.t @ 16901:5b89700cce30

tests: consistently use a HGEDITOR pattern that works with msys on windows Removing the need for an executable sh script that can be run from a native windows application enables some tests for running on windows.
author Mads Kiilerich <mads@kiilerich.com>
date Sun, 10 Jun 2012 14:41:14 +0200
parents 8149ff405c78
children f2719b387380
comparison
equal deleted inserted replaced
16900:3f1a153daadb 16901:5b89700cce30
1 $ "$TESTDIR/hghave" execbit || exit 80
2
3 Set up a repo 1 Set up a repo
4 2
5 $ echo "[ui]" >> $HGRCPATH 3 $ echo "[ui]" >> $HGRCPATH
6 $ echo "interactive=true" >> $HGRCPATH 4 $ echo "interactive=true" >> $HGRCPATH
7 $ echo "[extensions]" >> $HGRCPATH 5 $ echo "[extensions]" >> $HGRCPATH
1029 $ hg up -C 1027 $ hg up -C
1030 0 files updated, 0 files merged, 1 files removed, 0 files unresolved 1028 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1031 1029
1032 Editing patch 1030 Editing patch
1033 1031
1034 $ cat > editor << '__EOF__' 1032 $ cat > editor.sh << '__EOF__'
1035 > #!/bin/sh
1036 > sed -e 7d -e '5s/^-/ /' "$1" > tmp 1033 > sed -e 7d -e '5s/^-/ /' "$1" > tmp
1037 > mv tmp "$1" 1034 > mv tmp "$1"
1038 > __EOF__ 1035 > __EOF__
1039 $ chmod +x editor
1040 $ cat > editedfile << '__EOF__' 1036 $ cat > editedfile << '__EOF__'
1041 > This is the first line 1037 > This is the first line
1042 > This is the second line 1038 > This is the second line
1043 > This is the third line 1039 > This is the third line
1044 > __EOF__ 1040 > __EOF__
1047 $ cat > editedfile << '__EOF__' 1043 $ cat > editedfile << '__EOF__'
1048 > This line has changed 1044 > This line has changed
1049 > This change will be committed 1045 > This change will be committed
1050 > This is the third line 1046 > This is the third line
1051 > __EOF__ 1047 > __EOF__
1052 $ HGEDITOR="'`pwd`'"/editor hg record -d '23 0' -medit-patch-2 <<EOF 1048 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg record -d '23 0' -medit-patch-2 <<EOF
1053 > y 1049 > y
1054 > e 1050 > e
1055 > EOF 1051 > EOF
1056 diff --git a/editedfile b/editedfile 1052 diff --git a/editedfile b/editedfile
1057 1 hunks, 2 lines changed 1053 1 hunks, 2 lines changed
1092 Removing changes from patch 1088 Removing changes from patch
1093 1089
1094 $ sed -e '3s/third/second/' -e '2s/will/will not/' -e 1d editedfile > tmp 1090 $ sed -e '3s/third/second/' -e '2s/will/will not/' -e 1d editedfile > tmp
1095 $ mv tmp editedfile 1091 $ mv tmp editedfile
1096 $ echo "This line has been added" >> editedfile 1092 $ echo "This line has been added" >> editedfile
1097 $ cat > editor << '__EOF__' 1093 $ cat > editor.sh << '__EOF__'
1098 > #!/bin/sh
1099 > sed -e 's/^[-+]/ /' "$1" > tmp 1094 > sed -e 's/^[-+]/ /' "$1" > tmp
1100 > mv tmp "$1" 1095 > mv tmp "$1"
1101 > __EOF__ 1096 > __EOF__
1102 $ chmod +x editor 1097 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg record <<EOF
1103 $ HGEDITOR="'`pwd`'"/editor hg record <<EOF
1104 > y 1098 > y
1105 > e 1099 > e
1106 > EOF 1100 > EOF
1107 diff --git a/editedfile b/editedfile 1101 diff --git a/editedfile b/editedfile
1108 1 hunks, 3 lines changed 1102 1 hunks, 3 lines changed
1129 Invalid patch 1123 Invalid patch
1130 1124
1131 $ sed -e '3s/third/second/' -e '2s/will/will not/' -e 1d editedfile > tmp 1125 $ sed -e '3s/third/second/' -e '2s/will/will not/' -e 1d editedfile > tmp
1132 $ mv tmp editedfile 1126 $ mv tmp editedfile
1133 $ echo "This line has been added" >> editedfile 1127 $ echo "This line has been added" >> editedfile
1134 $ cat > editor << '__EOF__' 1128 $ cat > editor.sh << '__EOF__'
1135 > #!/bin/sh
1136 > sed s/This/That/ "$1" > tmp 1129 > sed s/This/That/ "$1" > tmp
1137 > mv tmp "$1" 1130 > mv tmp "$1"
1138 > __EOF__ 1131 > __EOF__
1139 $ chmod +x editor 1132 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg record <<EOF
1140 $ HGEDITOR="'`pwd`'"/editor hg record <<EOF
1141 > y 1133 > y
1142 > e 1134 > e
1143 > EOF 1135 > EOF
1144 diff --git a/editedfile b/editedfile 1136 diff --git a/editedfile b/editedfile
1145 1 hunks, 3 lines changed 1137 1 hunks, 3 lines changed