##// END OF EJS Templates
tests: consistently use a HGEDITOR pattern that works with msys on windows...
Mads Kiilerich -
r16901:5b89700c default
parent child Browse files
Show More
@@ -1,5 +1,3 b''
1 $ "$TESTDIR/hghave" execbit || exit 80
2
3 1 $ hg init
4 2
5 3 Setup:
@@ -127,13 +125,12 b' Test -u/-d:'
127 125
128 126 Open editor with old commit message if a message isn't given otherwise:
129 127
130 $ cat > editor << '__EOF__'
128 $ cat > editor.sh << '__EOF__'
131 129 > #!/bin/sh
132 130 > cat $1
133 131 > echo "another precious commit message" > "$1"
134 132 > __EOF__
135 $ chmod +x editor
136 $ HGEDITOR="'`pwd`'"/editor hg commit --amend -v
133 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -v
137 134 amending changeset 2c94e4a5756f
138 135 copying changeset 2c94e4a5756f to ad120869acf0
139 136 no changes, new message
@@ -160,7 +157,7 b' Open editor with old commit message if a'
160 157 Same, but with changes in working dir (different code path):
161 158
162 159 $ echo a >> a
163 $ HGEDITOR="'`pwd`'"/editor hg commit --amend -v
160 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -v
164 161 amending changeset ffb49186f961
165 162 another precious commit message
166 163
@@ -186,7 +183,7 b' Same, but with changes in working dir (d'
186 183 added 1 changesets with 1 changes to 1 files
187 184 committed changeset 1:fb6cca43446f
188 185
189 $ rm editor
186 $ rm editor.sh
190 187 $ hg log -r .
191 188 changeset: 1:fb6cca43446f
192 189 tag: tip
@@ -1,5 +1,3 b''
1 $ "$TESTDIR/hghave" system-sh || exit 80
2
3 1 $ echo "[extensions]" >> $HGRCPATH
4 2 $ echo "patchbomb=" >> $HGRCPATH
5 3
@@ -141,12 +139,10 b''
141 139
142 140 .hg/last-email.txt
143 141
144 $ cat > editor << '__EOF__'
145 > #!/bin/sh
142 $ cat > editor.sh << '__EOF__'
146 143 > echo "a precious introductory message" > "$1"
147 144 > __EOF__
148 $ chmod +x editor
149 $ HGEDITOR="'`pwd`'"/editor hg email -n -t foo -s test -r 0:tip > /dev/null
145 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg email -n -t foo -s test -r 0:tip > /dev/null
150 146 $ cat .hg/last-email.txt
151 147 a precious introductory message
152 148
@@ -1,5 +1,3 b''
1 $ "$TESTDIR/hghave" execbit || exit 80
2
3 1 Set up a repo
4 2
5 3 $ echo "[ui]" >> $HGRCPATH
@@ -1031,12 +1029,10 b' Abort early when a merge is in progress'
1031 1029
1032 1030 Editing patch
1033 1031
1034 $ cat > editor << '__EOF__'
1035 > #!/bin/sh
1032 $ cat > editor.sh << '__EOF__'
1036 1033 > sed -e 7d -e '5s/^-/ /' "$1" > tmp
1037 1034 > mv tmp "$1"
1038 1035 > __EOF__
1039 $ chmod +x editor
1040 1036 $ cat > editedfile << '__EOF__'
1041 1037 > This is the first line
1042 1038 > This is the second line
@@ -1049,7 +1045,7 b' Editing patch'
1049 1045 > This change will be committed
1050 1046 > This is the third line
1051 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 1049 > y
1054 1050 > e
1055 1051 > EOF
@@ -1094,13 +1090,11 b' Removing changes from patch'
1094 1090 $ sed -e '3s/third/second/' -e '2s/will/will not/' -e 1d editedfile > tmp
1095 1091 $ mv tmp editedfile
1096 1092 $ echo "This line has been added" >> editedfile
1097 $ cat > editor << '__EOF__'
1098 > #!/bin/sh
1093 $ cat > editor.sh << '__EOF__'
1099 1094 > sed -e 's/^[-+]/ /' "$1" > tmp
1100 1095 > mv tmp "$1"
1101 1096 > __EOF__
1102 $ chmod +x editor
1103 $ HGEDITOR="'`pwd`'"/editor hg record <<EOF
1097 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg record <<EOF
1104 1098 > y
1105 1099 > e
1106 1100 > EOF
@@ -1131,13 +1125,11 b' Invalid patch'
1131 1125 $ sed -e '3s/third/second/' -e '2s/will/will not/' -e 1d editedfile > tmp
1132 1126 $ mv tmp editedfile
1133 1127 $ echo "This line has been added" >> editedfile
1134 $ cat > editor << '__EOF__'
1135 > #!/bin/sh
1128 $ cat > editor.sh << '__EOF__'
1136 1129 > sed s/This/That/ "$1" > tmp
1137 1130 > mv tmp "$1"
1138 1131 > __EOF__
1139 $ chmod +x editor
1140 $ HGEDITOR="'`pwd`'"/editor hg record <<EOF
1132 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg record <<EOF
1141 1133 > y
1142 1134 > e
1143 1135 > EOF
@@ -110,12 +110,10 b' rollback by pretxncommit saves commit me'
110 110
111 111 same thing, but run $EDITOR
112 112
113 $ cat > editor << '__EOF__'
114 > #!/bin/sh
113 $ cat > editor.sh << '__EOF__'
115 114 > echo "another precious commit message" > "$1"
116 115 > __EOF__
117 $ chmod +x editor
118 $ HGEDITOR="'`pwd`'"/editor hg --config hooks.pretxncommit=false commit 2>&1
116 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg --config hooks.pretxncommit=false commit 2>&1
119 117 transaction abort!
120 118 rollback completed
121 119 note: commit message saved in .hg/last-message.txt
@@ -1,5 +1,3 b''
1 $ "$TESTDIR/hghave" system-sh || exit 80
2
3 1 $ hg init test
4 2 $ cd test
5 3
@@ -214,13 +212,11 b' tag and branch using same name'
214 212
215 213 test custom commit messages
216 214
217 $ cat > editor << '__EOF__'
218 > #!/bin/sh
215 $ cat > editor.sh << '__EOF__'
219 216 > echo "custom tag message" > "$1"
220 217 > echo "second line" >> "$1"
221 218 > __EOF__
222 $ chmod +x editor
223 $ HGEDITOR="'`pwd`'"/editor hg tag custom-tag -e
219 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg tag custom-tag -e
224 220 $ hg log -l1 --template "{desc}\n"
225 221 custom tag message
226 222 second line
@@ -235,7 +231,7 b' local tag with .hgtags modified'
235 231 $ hg st
236 232 M .hgtags
237 233 ? .hgtags.orig
238 ? editor
234 ? editor.sh
239 235 $ hg tag --local baz
240 236 $ hg revert --no-backup .hgtags
241 237
@@ -305,7 +301,7 b' commit hook on tag used to be run withou'
305 301
306 302 $ hg init repo-tag
307 303 $ hg init repo-tag-target
308 $ hg -R repo-tag --config hooks.commit="hg push \"`pwd`/repo-tag-target\"" tag tag
304 $ hg -R repo-tag --config hooks.commit="\"hg\" push \"`pwd`/repo-tag-target\"" tag tag
309 305 pushing to $TESTTMP/repo-tag-target
310 306 searching for changes
311 307 adding changesets
General Comments 0
You need to be logged in to leave comments. Login now