Show More
@@ -1,5 +1,3 b'' | |||||
1 | $ "$TESTDIR/hghave" execbit || exit 80 |
|
|||
2 |
|
||||
3 |
|
|
1 | $ hg init | |
4 |
|
2 | |||
5 | Setup: |
|
3 | Setup: | |
@@ -127,13 +125,12 b' Test -u/-d:' | |||||
127 |
|
125 | |||
128 | Open editor with old commit message if a message isn't given otherwise: |
|
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 | > #!/bin/sh |
|
129 | > #!/bin/sh | |
132 | > cat $1 |
|
130 | > cat $1 | |
133 | > echo "another precious commit message" > "$1" |
|
131 | > echo "another precious commit message" > "$1" | |
134 | > __EOF__ |
|
132 | > __EOF__ | |
135 | $ chmod +x editor |
|
133 | $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -v | |
136 | $ HGEDITOR="'`pwd`'"/editor hg commit --amend -v |
|
|||
137 | amending changeset 2c94e4a5756f |
|
134 | amending changeset 2c94e4a5756f | |
138 | copying changeset 2c94e4a5756f to ad120869acf0 |
|
135 | copying changeset 2c94e4a5756f to ad120869acf0 | |
139 | no changes, new message |
|
136 | no changes, new message | |
@@ -160,7 +157,7 b' Open editor with old commit message if a' | |||||
160 | Same, but with changes in working dir (different code path): |
|
157 | Same, but with changes in working dir (different code path): | |
161 |
|
158 | |||
162 | $ echo a >> a |
|
159 | $ echo a >> a | |
163 |
$ HGEDITOR=" |
|
160 | $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -v | |
164 | amending changeset ffb49186f961 |
|
161 | amending changeset ffb49186f961 | |
165 | another precious commit message |
|
162 | another precious commit message | |
166 |
|
163 | |||
@@ -186,7 +183,7 b' Same, but with changes in working dir (d' | |||||
186 | added 1 changesets with 1 changes to 1 files |
|
183 | added 1 changesets with 1 changes to 1 files | |
187 | committed changeset 1:fb6cca43446f |
|
184 | committed changeset 1:fb6cca43446f | |
188 |
|
185 | |||
189 | $ rm editor |
|
186 | $ rm editor.sh | |
190 | $ hg log -r . |
|
187 | $ hg log -r . | |
191 | changeset: 1:fb6cca43446f |
|
188 | changeset: 1:fb6cca43446f | |
192 | tag: tip |
|
189 | tag: tip |
@@ -1,5 +1,3 b'' | |||||
1 | $ "$TESTDIR/hghave" system-sh || exit 80 |
|
|||
2 |
|
||||
3 |
|
|
1 | $ echo "[extensions]" >> $HGRCPATH | |
4 | $ echo "patchbomb=" >> $HGRCPATH |
|
2 | $ echo "patchbomb=" >> $HGRCPATH | |
5 |
|
3 | |||
@@ -141,12 +139,10 b'' | |||||
141 |
|
139 | |||
142 | .hg/last-email.txt |
|
140 | .hg/last-email.txt | |
143 |
|
141 | |||
144 | $ cat > editor << '__EOF__' |
|
142 | $ cat > editor.sh << '__EOF__' | |
145 | > #!/bin/sh |
|
|||
146 | > echo "a precious introductory message" > "$1" |
|
143 | > echo "a precious introductory message" > "$1" | |
147 | > __EOF__ |
|
144 | > __EOF__ | |
148 | $ chmod +x editor |
|
145 | $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg email -n -t foo -s test -r 0:tip > /dev/null | |
149 | $ HGEDITOR="'`pwd`'"/editor hg email -n -t foo -s test -r 0:tip > /dev/null |
|
|||
150 | $ cat .hg/last-email.txt |
|
146 | $ cat .hg/last-email.txt | |
151 | a precious introductory message |
|
147 | a precious introductory message | |
152 |
|
148 |
@@ -1,5 +1,3 b'' | |||||
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 | |
@@ -1031,12 +1029,10 b' Abort early when a merge is in progress' | |||||
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 | |
@@ -1049,7 +1045,7 b' Editing patch' | |||||
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=" |
|
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 | |
@@ -1094,13 +1090,11 b' Removing changes from patch' | |||||
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 | |
@@ -1131,13 +1125,11 b' Invalid patch' | |||||
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 |
@@ -110,12 +110,10 b' rollback by pretxncommit saves commit me' | |||||
110 |
|
110 | |||
111 | same thing, but run $EDITOR |
|
111 | same thing, but run $EDITOR | |
112 |
|
112 | |||
113 | $ cat > editor << '__EOF__' |
|
113 | $ cat > editor.sh << '__EOF__' | |
114 | > #!/bin/sh |
|
|||
115 | > echo "another precious commit message" > "$1" |
|
114 | > echo "another precious commit message" > "$1" | |
116 | > __EOF__ |
|
115 | > __EOF__ | |
117 | $ chmod +x editor |
|
116 | $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg --config hooks.pretxncommit=false commit 2>&1 | |
118 | $ HGEDITOR="'`pwd`'"/editor hg --config hooks.pretxncommit=false commit 2>&1 |
|
|||
119 | transaction abort! |
|
117 | transaction abort! | |
120 | rollback completed |
|
118 | rollback completed | |
121 | note: commit message saved in .hg/last-message.txt |
|
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 | $ cd test |
|
2 | $ cd test | |
5 |
|
3 | |||
@@ -214,13 +212,11 b' tag and branch using same name' | |||||
214 |
|
212 | |||
215 | test custom commit messages |
|
213 | test custom commit messages | |
216 |
|
214 | |||
217 | $ cat > editor << '__EOF__' |
|
215 | $ cat > editor.sh << '__EOF__' | |
218 | > #!/bin/sh |
|
|||
219 | > echo "custom tag message" > "$1" |
|
216 | > echo "custom tag message" > "$1" | |
220 | > echo "second line" >> "$1" |
|
217 | > echo "second line" >> "$1" | |
221 | > __EOF__ |
|
218 | > __EOF__ | |
222 | $ chmod +x editor |
|
219 | $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg tag custom-tag -e | |
223 | $ HGEDITOR="'`pwd`'"/editor hg tag custom-tag -e |
|
|||
224 | $ hg log -l1 --template "{desc}\n" |
|
220 | $ hg log -l1 --template "{desc}\n" | |
225 | custom tag message |
|
221 | custom tag message | |
226 | second line |
|
222 | second line | |
@@ -235,7 +231,7 b' local tag with .hgtags modified' | |||||
235 | $ hg st |
|
231 | $ hg st | |
236 | M .hgtags |
|
232 | M .hgtags | |
237 | ? .hgtags.orig |
|
233 | ? .hgtags.orig | |
238 | ? editor |
|
234 | ? editor.sh | |
239 | $ hg tag --local baz |
|
235 | $ hg tag --local baz | |
240 | $ hg revert --no-backup .hgtags |
|
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 | $ hg init repo-tag |
|
302 | $ hg init repo-tag | |
307 | $ hg init repo-tag-target |
|
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 | pushing to $TESTTMP/repo-tag-target |
|
305 | pushing to $TESTTMP/repo-tag-target | |
310 | searching for changes |
|
306 | searching for changes | |
311 | adding changesets |
|
307 | adding changesets |
General Comments 0
You need to be logged in to leave comments.
Login now