Show More
@@ -161,10 +161,12 b' Test pushing to a server that has a pret' | |||||
161 | > import sys |
|
161 | > import sys | |
162 | > def hook1line(ui, repo, **kwargs): |
|
162 | > def hook1line(ui, repo, **kwargs): | |
163 | > ui.write(b'ui.write 1 line\n') |
|
163 | > ui.write(b'ui.write 1 line\n') | |
|
164 | > ui.flush() | |||
164 |
|
|
165 | > return 1 | |
165 | > def hook2lines(ui, repo, **kwargs): |
|
166 | > def hook2lines(ui, repo, **kwargs): | |
166 | > ui.write(b'ui.write 2 lines 1\n') |
|
167 | > ui.write(b'ui.write 2 lines 1\n') | |
167 | > ui.write(b'ui.write 2 lines 2\n') |
|
168 | > ui.write(b'ui.write 2 lines 2\n') | |
|
169 | > ui.flush() | |||
168 |
|
|
170 | > return 1 | |
169 | > def hook1lineflush(ui, repo, **kwargs): |
|
171 | > def hook1lineflush(ui, repo, **kwargs): | |
170 | > ui.write(b'ui.write 1 line flush\n') |
|
172 | > ui.write(b'ui.write 1 line flush\n') | |
@@ -181,21 +183,31 b' Test pushing to a server that has a pret' | |||||
181 | > ui.write_err(b'ui.write_err 1\n') |
|
183 | > ui.write_err(b'ui.write_err 1\n') | |
182 | > ui.write(b'ui.write 2\n') |
|
184 | > ui.write(b'ui.write 2\n') | |
183 | > ui.write_err(b'ui.write_err 2\n') |
|
185 | > ui.write_err(b'ui.write_err 2\n') | |
|
186 | > ui.flush() | |||
184 |
|
|
187 | > return 1 | |
185 | > def hookprintstdout(ui, repo, **kwargs): |
|
188 | > def hookprintstdout(ui, repo, **kwargs): | |
186 | > print('printed line') |
|
189 | > print('printed line') | |
|
190 | > sys.stdout.flush() | |||
187 | > return 1 |
|
191 | > return 1 | |
188 | > def hookprintandwrite(ui, repo, **kwargs): |
|
192 | > def hookprintandwrite(ui, repo, **kwargs): | |
189 | > print('print 1') |
|
193 | > print('print 1') | |
|
194 | > sys.stdout.flush() | |||
190 | > ui.write(b'ui.write 1\n') |
|
195 | > ui.write(b'ui.write 1\n') | |
|
196 | > ui.flush() | |||
191 |
|
|
197 | > print('print 2') | |
|
198 | > sys.stdout.flush() | |||
192 | > ui.write(b'ui.write 2\n') |
|
199 | > ui.write(b'ui.write 2\n') | |
|
200 | > ui.flush() | |||
193 |
|
|
201 | > return 1 | |
194 | > def hookprintstderrandstdout(ui, repo, **kwargs): |
|
202 | > def hookprintstderrandstdout(ui, repo, **kwargs): | |
195 | > print('stdout 1') |
|
203 | > print('stdout 1') | |
|
204 | > sys.stdout.flush() | |||
196 | > print('stderr 1', file=sys.stderr) |
|
205 | > print('stderr 1', file=sys.stderr) | |
|
206 | > sys.stderr.flush() | |||
197 | > print('stdout 2') |
|
207 | > print('stdout 2') | |
|
208 | > sys.stdout.flush() | |||
198 | > print('stderr 2', file=sys.stderr) |
|
209 | > print('stderr 2', file=sys.stderr) | |
|
210 | > sys.stderr.flush() | |||
199 | > return 1 |
|
211 | > return 1 | |
200 | > EOF |
|
212 | > EOF | |
201 |
|
213 | |||
@@ -1046,10 +1058,10 b' Mixed print() and ui.write() are both ca' | |||||
1046 | e> adding manifests\n |
|
1058 | e> adding manifests\n | |
1047 | e> adding file changes\n |
|
1059 | e> adding file changes\n | |
1048 | e> added 1 changesets with 1 changes to 1 files\n |
|
1060 | e> added 1 changesets with 1 changes to 1 files\n | |
|
1061 | e> print 1\n | |||
1049 | e> ui.write 1\n |
|
1062 | e> ui.write 1\n | |
|
1063 | e> print 2\n | |||
1050 | e> ui.write 2\n |
|
1064 | e> ui.write 2\n | |
1051 | e> print 1\n |
|
|||
1052 | e> print 2\n |
|
|||
1053 | e> transaction abort!\n |
|
1065 | e> transaction abort!\n | |
1054 | e> rollback completed\n |
|
1066 | e> rollback completed\n | |
1055 | e> abort: pretxnchangegroup.fail hook failed\n |
|
1067 | e> abort: pretxnchangegroup.fail hook failed\n | |
@@ -1106,10 +1118,10 b' Mixed print() and ui.write() are both ca' | |||||
1106 | e> adding manifests\n |
|
1118 | e> adding manifests\n | |
1107 | e> adding file changes\n |
|
1119 | e> adding file changes\n | |
1108 | e> added 1 changesets with 1 changes to 1 files\n |
|
1120 | e> added 1 changesets with 1 changes to 1 files\n | |
|
1121 | e> print 1\n | |||
1109 | e> ui.write 1\n |
|
1122 | e> ui.write 1\n | |
|
1123 | e> print 2\n | |||
1110 | e> ui.write 2\n |
|
1124 | e> ui.write 2\n | |
1111 | e> print 1\n |
|
|||
1112 | e> print 2\n |
|
|||
1113 | e> transaction abort!\n |
|
1125 | e> transaction abort!\n | |
1114 | e> rollback completed\n |
|
1126 | e> rollback completed\n | |
1115 | e> abort: pretxnchangegroup.fail hook failed\n |
|
1127 | e> abort: pretxnchangegroup.fail hook failed\n | |
@@ -1180,10 +1192,10 b' print() to stdout and stderr both get ca' | |||||
1180 | e> adding manifests\n |
|
1192 | e> adding manifests\n | |
1181 | e> adding file changes\n |
|
1193 | e> adding file changes\n | |
1182 | e> added 1 changesets with 1 changes to 1 files\n |
|
1194 | e> added 1 changesets with 1 changes to 1 files\n | |
|
1195 | e> stdout 1\n | |||
1183 | e> stderr 1\n |
|
1196 | e> stderr 1\n | |
|
1197 | e> stdout 2\n | |||
1184 | e> stderr 2\n |
|
1198 | e> stderr 2\n | |
1185 | e> stdout 1\n |
|
|||
1186 | e> stdout 2\n |
|
|||
1187 | e> transaction abort!\n |
|
1199 | e> transaction abort!\n | |
1188 | e> rollback completed\n |
|
1200 | e> rollback completed\n | |
1189 | e> abort: pretxnchangegroup.fail hook failed\n |
|
1201 | e> abort: pretxnchangegroup.fail hook failed\n | |
@@ -1240,10 +1252,10 b' print() to stdout and stderr both get ca' | |||||
1240 | e> adding manifests\n |
|
1252 | e> adding manifests\n | |
1241 | e> adding file changes\n |
|
1253 | e> adding file changes\n | |
1242 | e> added 1 changesets with 1 changes to 1 files\n |
|
1254 | e> added 1 changesets with 1 changes to 1 files\n | |
|
1255 | e> stdout 1\n | |||
1243 | e> stderr 1\n |
|
1256 | e> stderr 1\n | |
|
1257 | e> stdout 2\n | |||
1244 | e> stderr 2\n |
|
1258 | e> stderr 2\n | |
1245 | e> stdout 1\n |
|
|||
1246 | e> stdout 2\n |
|
|||
1247 | e> transaction abort!\n |
|
1259 | e> transaction abort!\n | |
1248 | e> rollback completed\n |
|
1260 | e> rollback completed\n | |
1249 | e> abort: pretxnchangegroup.fail hook failed\n |
|
1261 | e> abort: pretxnchangegroup.fail hook failed\n | |
@@ -1731,10 +1743,10 b' Shell and Python hooks writing to stdout' | |||||
1731 | e> shell stderr 1\n |
|
1743 | e> shell stderr 1\n | |
1732 | e> shell stdout 2\n |
|
1744 | e> shell stdout 2\n | |
1733 | e> shell stderr 2\n |
|
1745 | e> shell stderr 2\n | |
|
1746 | e> stdout 1\n | |||
1734 | e> stderr 1\n |
|
1747 | e> stderr 1\n | |
|
1748 | e> stdout 2\n | |||
1735 | e> stderr 2\n |
|
1749 | e> stderr 2\n | |
1736 | e> stdout 1\n |
|
|||
1737 | e> stdout 2\n |
|
|||
1738 | e> transaction abort!\n |
|
1750 | e> transaction abort!\n | |
1739 | e> rollback completed\n |
|
1751 | e> rollback completed\n | |
1740 | e> abort: pretxnchangegroup.b hook failed\n |
|
1752 | e> abort: pretxnchangegroup.b hook failed\n | |
@@ -1795,10 +1807,10 b' Shell and Python hooks writing to stdout' | |||||
1795 | e> shell stderr 1\n |
|
1807 | e> shell stderr 1\n | |
1796 | e> shell stdout 2\n |
|
1808 | e> shell stdout 2\n | |
1797 | e> shell stderr 2\n |
|
1809 | e> shell stderr 2\n | |
|
1810 | e> stdout 1\n | |||
1798 | e> stderr 1\n |
|
1811 | e> stderr 1\n | |
|
1812 | e> stdout 2\n | |||
1799 | e> stderr 2\n |
|
1813 | e> stderr 2\n | |
1800 | e> stdout 1\n |
|
|||
1801 | e> stdout 2\n |
|
|||
1802 | e> transaction abort!\n |
|
1814 | e> transaction abort!\n | |
1803 | e> rollback completed\n |
|
1815 | e> rollback completed\n | |
1804 | e> abort: pretxnchangegroup.b hook failed\n |
|
1816 | e> abort: pretxnchangegroup.b hook failed\n |
@@ -272,12 +272,14 b' a bad, evil hook that prints to stdout' | |||||
272 | $ cat <<EOF > $TESTTMP/badhook |
|
272 | $ cat <<EOF > $TESTTMP/badhook | |
273 | > import sys |
|
273 | > import sys | |
274 | > sys.stdout.write("KABOOM\n") |
|
274 | > sys.stdout.write("KABOOM\n") | |
|
275 | > sys.stdout.flush() | |||
275 | > EOF |
|
276 | > EOF | |
276 |
|
277 | |||
277 | $ cat <<EOF > $TESTTMP/badpyhook.py |
|
278 | $ cat <<EOF > $TESTTMP/badpyhook.py | |
278 | > import sys |
|
279 | > import sys | |
279 | > def hook(ui, repo, hooktype, **kwargs): |
|
280 | > def hook(ui, repo, hooktype, **kwargs): | |
280 | > sys.stdout.write("KABOOM IN PROCESS\n") |
|
281 | > sys.stdout.write("KABOOM IN PROCESS\n") | |
|
282 | > sys.stdout.flush() | |||
281 | > EOF |
|
283 | > EOF | |
282 |
|
284 | |||
283 | $ cat <<EOF >> ../remote/.hg/hgrc |
|
285 | $ cat <<EOF >> ../remote/.hg/hgrc | |
@@ -456,6 +458,7 b' stderr from remote commands should be pr' | |||||
456 | > def wrappedpush(orig, repo, *args, **kwargs): |
|
458 | > def wrappedpush(orig, repo, *args, **kwargs): | |
457 | > res = orig(repo, *args, **kwargs) |
|
459 | > res = orig(repo, *args, **kwargs) | |
458 | > repo.ui.write('local stdout\n') |
|
460 | > repo.ui.write('local stdout\n') | |
|
461 | > repo.ui.flush() | |||
459 | > return res |
|
462 | > return res | |
460 | > |
|
463 | > | |
461 | > def extsetup(ui): |
|
464 | > def extsetup(ui): |
General Comments 0
You need to be logged in to leave comments.
Login now