##// END OF EJS Templates
util: flush stdout before calling external processes...
Mads Kiilerich -
r13439:d724a693 stable
parent child Browse files
Show More
@@ -386,6 +386,10 def system(cmd, environ={}, cwd=None, on
386 386
387 387 if out is specified, it is assumed to be a file-like object that has a
388 388 write() method. stdout and stderr will be redirected to out.'''
389 try:
390 sys.stdout.flush()
391 except Exception:
392 pass
389 393 def py2shell(val):
390 394 'convert python object into string that is useful to shell'
391 395 if val is None or val is False:
@@ -204,13 +204,13 doesn't work (yet ?)
204 204 hg -R bundle://../full.hg verify
205 205
206 206 $ hg pull bundle://../full.hg
207 changegroup hook: HG_NODE=f9ee2f85a263049e9ae6d37a0e67e96194ffb735 HG_SOURCE=pull HG_URL=bundle:../full.hg
208 207 pulling from bundle://../full.hg
209 208 requesting all changes
210 209 adding changesets
211 210 adding manifests
212 211 adding file changes
213 212 added 9 changesets with 7 changes to 4 files (+1 heads)
213 changegroup hook: HG_NODE=f9ee2f85a263049e9ae6d37a0e67e96194ffb735 HG_SOURCE=pull HG_URL=bundle:../full.hg
214 214 (run 'hg heads' to see heads, 'hg merge' to merge)
215 215
216 216 Rollback empty
@@ -227,13 +227,13 Log -R bundle:empty+full.hg
227 227 Pull full.hg into empty again (using -R; with hook)
228 228
229 229 $ hg -R empty pull full.hg
230 changegroup hook: HG_NODE=f9ee2f85a263049e9ae6d37a0e67e96194ffb735 HG_SOURCE=pull HG_URL=bundle:empty+full.hg
231 230 pulling from full.hg
232 231 requesting all changes
233 232 adding changesets
234 233 adding manifests
235 234 adding file changes
236 235 added 9 changesets with 7 changes to 4 files (+1 heads)
236 changegroup hook: HG_NODE=f9ee2f85a263049e9ae6d37a0e67e96194ffb735 HG_SOURCE=pull HG_URL=bundle:empty+full.hg
237 237 (run 'hg heads' to see heads, 'hg merge' to merge)
238 238
239 239 Create partial clones
@@ -55,10 +55,10 Merging:
55 55 (run 'hg heads' to see heads, 'hg merge' to merge)
56 56
57 57 $ hg merge -v
58 merging for foo
59 58 resolving manifests
60 59 getting bar
61 60 merging foo
61 merging for foo
62 62 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
63 63 (branch merge, don't forget to commit)
64 64
@@ -76,17 +76,17 test generic hooks
76 76
77 77 $ cd ../b
78 78 $ hg pull ../a
79 pulling from ../a
80 searching for changes
79 81 prechangegroup hook: HG_SOURCE=pull HG_URL=file:$TESTTMP/a
82 adding changesets
83 adding manifests
84 adding file changes
85 added 3 changesets with 2 changes to 2 files
80 86 changegroup hook: HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_SOURCE=pull HG_URL=file:$TESTTMP/a
81 87 incoming hook: HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_SOURCE=pull HG_URL=file:$TESTTMP/a
82 88 incoming hook: HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_SOURCE=pull HG_URL=file:$TESTTMP/a
83 89 incoming hook: HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_SOURCE=pull HG_URL=file:$TESTTMP/a
84 pulling from ../a
85 searching for changes
86 adding changesets
87 adding manifests
88 adding file changes
89 added 3 changesets with 2 changes to 2 files
90 90 (run 'hg update' to get a working copy)
91 91
92 92 tag hooks can see env vars
@@ -176,9 +176,9 prechangegroup hook can prevent incoming
176 176 $ echo '[hooks]' > .hg/hgrc
177 177 $ echo 'prechangegroup.forbid = python "$TESTDIR"/printenv.py prechangegroup.forbid 1' >> .hg/hgrc
178 178 $ hg pull ../a
179 prechangegroup.forbid hook: HG_SOURCE=pull HG_URL=file:$TESTTMP/a
180 179 pulling from ../a
181 180 searching for changes
181 prechangegroup.forbid hook: HG_SOURCE=pull HG_URL=file:$TESTTMP/a
182 182 abort: prechangegroup.forbid hook exited with status 1
183 183 [255]
184 184
@@ -189,14 +189,14 incoming changes no longer there after
189 189 $ echo 'pretxnchangegroup.forbid0 = hg tip -q' >> .hg/hgrc
190 190 $ echo 'pretxnchangegroup.forbid1 = python "$TESTDIR"/printenv.py pretxnchangegroup.forbid 1' >> .hg/hgrc
191 191 $ hg pull ../a
192 4:539e4b31b6dc
193 pretxnchangegroup.forbid hook: HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PENDING=$TESTTMP/b HG_SOURCE=pull HG_URL=file:$TESTTMP/a
194 192 pulling from ../a
195 193 searching for changes
196 194 adding changesets
197 195 adding manifests
198 196 adding file changes
199 197 added 1 changesets with 1 changes to 1 files
198 4:539e4b31b6dc
199 pretxnchangegroup.forbid hook: HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PENDING=$TESTTMP/b HG_SOURCE=pull HG_URL=file:$TESTTMP/a
200 200 transaction abort!
201 201 rollback completed
202 202 abort: pretxnchangegroup.forbid1 hook exited with status 1
@@ -211,11 +211,11 outgoing hooks can see env vars
211 211 $ echo 'preoutgoing = python "$TESTDIR"/printenv.py preoutgoing' >> ../a/.hg/hgrc
212 212 $ echo 'outgoing = python "$TESTDIR"/printenv.py outgoing' >> ../a/.hg/hgrc
213 213 $ hg pull ../a
214 preoutgoing hook: HG_SOURCE=pull
215 outgoing hook: HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_SOURCE=pull
216 214 pulling from ../a
217 215 searching for changes
216 preoutgoing hook: HG_SOURCE=pull
218 217 adding changesets
218 outgoing hook: HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_SOURCE=pull
219 219 adding manifests
220 220 adding file changes
221 221 added 1 changesets with 1 changes to 1 files
@@ -227,10 +227,10 preoutgoing hook can prevent outgoing ch
227 227
228 228 $ echo 'preoutgoing.forbid = python "$TESTDIR"/printenv.py preoutgoing.forbid 1' >> ../a/.hg/hgrc
229 229 $ hg pull ../a
230 pulling from ../a
231 searching for changes
230 232 preoutgoing hook: HG_SOURCE=pull
231 233 preoutgoing.forbid hook: HG_SOURCE=pull
232 pulling from ../a
233 searching for changes
234 234 abort: preoutgoing.forbid hook exited with status 1
235 235 [255]
236 236
@@ -76,12 +76,12 pull
76 76 $ echo '[hooks]' >> .hg/hgrc
77 77 $ echo 'changegroup = python "$TESTDIR"/printenv.py changegroup' >> .hg/hgrc
78 78 $ hg pull
79 changegroup hook: HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_URL=http://localhost:$HGPORT1/
80 79 pulling from http://localhost:$HGPORT1/
81 80 searching for changes
82 81 adding changesets
83 82 adding manifests
84 83 adding file changes
85 84 added 1 changesets with 1 changes to 1 files
85 changegroup hook: HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_URL=http://localhost:$HGPORT1/
86 86 (run 'hg update' to get a working copy)
87 87 $ cd ..
@@ -134,13 +134,13 pull without cacert
134 134 $ echo "changegroup = python '$TESTDIR'/printenv.py changegroup" >> .hg/hgrc
135 135 $ hg pull
136 136 warning: localhost certificate with fingerprint 91:4f:1a:ff:87:24:9c:09:b6:85:9b:88:b1:90:6d:30:75:64:91:ca not verified (check hostfingerprints or web.cacerts config setting)
137 changegroup hook: HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_URL=https://localhost:$HGPORT/
138 137 pulling from https://localhost:$HGPORT/
139 138 searching for changes
140 139 adding changesets
141 140 adding manifests
142 141 adding file changes
143 142 added 1 changesets with 1 changes to 1 files
143 changegroup hook: HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_URL=https://localhost:$HGPORT/
144 144 warning: localhost certificate with fingerprint 91:4f:1a:ff:87:24:9c:09:b6:85:9b:88:b1:90:6d:30:75:64:91:ca not verified (check hostfingerprints or web.cacerts config setting)
145 145 (run 'hg update' to get a working copy)
146 146 $ cd ..
@@ -38,11 +38,11 Merge them and display *_ISLINK vars
38 38 merge heads
39 39
40 40 $ hg merge --tool="python ../echo.py"
41 merging l
41 42 HG_FILE l
42 43 HG_MY_ISLINK 1
43 44 HG_OTHER_ISLINK 0
44 45 HG_BASE_ISLINK 0
45 merging l
46 46 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
47 47 (branch merge, don't forget to commit)
48 48
@@ -54,9 +54,9 merge working directory
54 54 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
55 55 $ hg copy l l2
56 56 $ HGMERGE="python ../echo.py" hg up 3
57 merging l2
57 58 HG_FILE l2
58 59 HG_MY_ISLINK 1
59 60 HG_OTHER_ISLINK 0
60 61 HG_BASE_ISLINK 0
61 merging l2
62 62 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
@@ -219,13 +219,13 but true.executable set to cat found in
219 219 true.executable=cat
220 220 # hg update -C 1
221 221 # hg merge -r 2
222 merging f
222 223 revision 1
223 224 space
224 225 revision 0
225 226 space
226 227 revision 2
227 228 space
228 merging f
229 229 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
230 230 (branch merge, don't forget to commit)
231 231 # cat f
@@ -244,13 +244,13 and true.executable set to cat with path
244 244 true.executable=cat
245 245 # hg update -C 1
246 246 # hg merge -r 2 --config merge-tools.true.executable=cat
247 merging f
247 248 revision 1
248 249 space
249 250 revision 0
250 251 space
251 252 revision 2
252 253 space
253 merging f
254 254 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
255 255 (branch merge, don't forget to commit)
256 256 # cat f
@@ -598,6 +598,7 Default is silent simplemerge:
598 598 true.executable=cat
599 599 # hg update -C 1
600 600 # hg merge -r 3 --config merge-tools.true.premerge=False
601 merging f
601 602 revision 1
602 603 space
603 604 revision 0
@@ -605,7 +606,6 Default is silent simplemerge:
605 606 revision 0
606 607 space
607 608 revision 3
608 merging f
609 609 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
610 610 (branch merge, don't forget to commit)
611 611 # cat f
@@ -631,6 +631,7 Tool execution
631 631 # hg update -C 1
632 632 $ hg merge -r 2 --config merge-tools.true.executable=head --config merge-tools.true.args='$base $local $other $output' \
633 633 > | sed 's,==> .* <==,==> ... <==,g'
634 merging f
634 635 ==> ... <==
635 636 revision 0
636 637 space
@@ -646,7 +647,6 Tool execution
646 647 ==> ... <==
647 648 revision 1
648 649 space
649 merging f
650 650 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
651 651 (branch merge, don't forget to commit)
652 652 $ aftermerge
@@ -757,13 +757,13 cat is a bad merge-tool and doesn't chan
757 757 true.executable=cat
758 758 # hg update -C 1
759 759 # hg merge -y -r 2 --config merge-tools.true.checkchanged=1
760 merging f
760 761 revision 1
761 762 space
762 763 revision 0
763 764 space
764 765 revision 2
765 766 space
766 merging f
767 767 output file f appears unchanged
768 768 was merge successful (yn)? n
769 769 merging f failed!
@@ -72,8 +72,8 merge should fail
72 72 [255]
73 73 merge of b expected
74 74 $ hg merge -f 1
75 merging b
75 76 merging for b
76 merging b
77 77 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
78 78 (branch merge, don't forget to commit)
79 79 $ hg diff --nodates
@@ -153,8 +153,8 merge of b should fail
153 153 [255]
154 154 merge of b expected
155 155 $ hg merge -f 2
156 merging b
156 157 merging for b
157 merging b
158 158 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
159 159 (branch merge, don't forget to commit)
160 160 $ hg diff --nodates
@@ -159,12 +159,12
159 159 $ hg email -m test.mbox -f quux -t foo -c bar -s test 0:tip \
160 160 > --config extensions.progress= --config progress.assume-tty=1 \
161 161 > --config progress.delay=0 --config progress.refresh=0
162 \rwriting [ ] 0/3\rwriting [ ] 0/3\r \r\r \r\rwriting [====================> ] 1/3\rwriting [====================> ] 1/3\r \r\r \r\rwriting [==========================================> ] 2/3\rwriting [==========================================> ] 2/3\r \rThis patch series consists of 2 patches. (esc)
162 This patch series consists of 2 patches.
163 163
164 164
165 165 Write the introductory message for the patch series.
166 166
167
167 \rwriting [ ] 0/3\rwriting [ ] 0/3\r \r\r \r\rwriting [====================> ] 1/3\rwriting [====================> ] 1/3\r \r\r \r\rwriting [==========================================> ] 2/3\rwriting [==========================================> ] 2/3\r \r (esc)
168 168 Writing [PATCH 0 of 2] test ...
169 169 Writing [PATCH 1 of 2] a ...
170 170 Writing [PATCH 2 of 2] b ...
@@ -42,10 +42,10 start a pull...
42 42 ... and start another pull before the first one has finished
43 43
44 44 $ sleep 1
45 pulling from ../source1
46 requesting all changes
45 47 $ hg pull ../source2 2>/dev/null
46 48 pulling from ../source2
47 pulling from ../source1
48 requesting all changes
49 49 adding changesets
50 50 adding manifests
51 51 adding file changes
@@ -68,13 +68,13 check for HTTP opener failures when cach
68 68 $ echo '[hooks]' >> .hg/hgrc
69 69 $ echo 'changegroup = python "$TESTDIR"/printenv.py changegroup' >> .hg/hgrc
70 70 $ hg pull
71 changegroup hook: HG_NODE=4ac2e3648604439c580c69b09ec9d93a88d93432 HG_SOURCE=pull HG_URL=http://localhost:$HGPORT/remote
72 71 pulling from static-http://localhost:$HGPORT/remote
73 72 searching for changes
74 73 adding changesets
75 74 adding manifests
76 75 adding file changes
77 76 added 1 changesets with 1 changes to 1 files
77 changegroup hook: HG_NODE=4ac2e3648604439c580c69b09ec9d93a88d93432 HG_SOURCE=pull HG_URL=http://localhost:$HGPORT/remote
78 78 (run 'hg update' to get a working copy)
79 79
80 80 trying to push
General Comments 0
You need to be logged in to leave comments. Login now