diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -386,6 +386,10 @@ def system(cmd, environ={}, cwd=None, on if out is specified, it is assumed to be a file-like object that has a write() method. stdout and stderr will be redirected to out.''' + try: + sys.stdout.flush() + except Exception: + pass def py2shell(val): 'convert python object into string that is useful to shell' if val is None or val is False: diff --git a/tests/test-bundle.t b/tests/test-bundle.t --- a/tests/test-bundle.t +++ b/tests/test-bundle.t @@ -204,13 +204,13 @@ doesn't work (yet ?) hg -R bundle://../full.hg verify $ hg pull bundle://../full.hg - changegroup hook: HG_NODE=f9ee2f85a263049e9ae6d37a0e67e96194ffb735 HG_SOURCE=pull HG_URL=bundle:../full.hg pulling from bundle://../full.hg requesting all changes adding changesets adding manifests adding file changes added 9 changesets with 7 changes to 4 files (+1 heads) + changegroup hook: HG_NODE=f9ee2f85a263049e9ae6d37a0e67e96194ffb735 HG_SOURCE=pull HG_URL=bundle:../full.hg (run 'hg heads' to see heads, 'hg merge' to merge) Rollback empty @@ -227,13 +227,13 @@ Log -R bundle:empty+full.hg Pull full.hg into empty again (using -R; with hook) $ hg -R empty pull full.hg - changegroup hook: HG_NODE=f9ee2f85a263049e9ae6d37a0e67e96194ffb735 HG_SOURCE=pull HG_URL=bundle:empty+full.hg pulling from full.hg requesting all changes adding changesets adding manifests adding file changes added 9 changesets with 7 changes to 4 files (+1 heads) + changegroup hook: HG_NODE=f9ee2f85a263049e9ae6d37a0e67e96194ffb735 HG_SOURCE=pull HG_URL=bundle:empty+full.hg (run 'hg heads' to see heads, 'hg merge' to merge) Create partial clones diff --git a/tests/test-filebranch.t b/tests/test-filebranch.t --- a/tests/test-filebranch.t +++ b/tests/test-filebranch.t @@ -55,10 +55,10 @@ Merging: (run 'hg heads' to see heads, 'hg merge' to merge) $ hg merge -v - merging for foo resolving manifests getting bar merging foo + merging for foo 1 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) diff --git a/tests/test-hook.t b/tests/test-hook.t --- a/tests/test-hook.t +++ b/tests/test-hook.t @@ -76,17 +76,17 @@ test generic hooks $ cd ../b $ hg pull ../a + pulling from ../a + searching for changes prechangegroup hook: HG_SOURCE=pull HG_URL=file:$TESTTMP/a + adding changesets + adding manifests + adding file changes + added 3 changesets with 2 changes to 2 files changegroup hook: HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_SOURCE=pull HG_URL=file:$TESTTMP/a incoming hook: HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_SOURCE=pull HG_URL=file:$TESTTMP/a incoming hook: HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_SOURCE=pull HG_URL=file:$TESTTMP/a incoming hook: HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_SOURCE=pull HG_URL=file:$TESTTMP/a - pulling from ../a - searching for changes - adding changesets - adding manifests - adding file changes - added 3 changesets with 2 changes to 2 files (run 'hg update' to get a working copy) tag hooks can see env vars @@ -176,9 +176,9 @@ prechangegroup hook can prevent incoming $ echo '[hooks]' > .hg/hgrc $ echo 'prechangegroup.forbid = python "$TESTDIR"/printenv.py prechangegroup.forbid 1' >> .hg/hgrc $ hg pull ../a - prechangegroup.forbid hook: HG_SOURCE=pull HG_URL=file:$TESTTMP/a pulling from ../a searching for changes + prechangegroup.forbid hook: HG_SOURCE=pull HG_URL=file:$TESTTMP/a abort: prechangegroup.forbid hook exited with status 1 [255] @@ -189,14 +189,14 @@ incoming changes no longer there after $ echo 'pretxnchangegroup.forbid0 = hg tip -q' >> .hg/hgrc $ echo 'pretxnchangegroup.forbid1 = python "$TESTDIR"/printenv.py pretxnchangegroup.forbid 1' >> .hg/hgrc $ hg pull ../a - 4:539e4b31b6dc - pretxnchangegroup.forbid hook: HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PENDING=$TESTTMP/b HG_SOURCE=pull HG_URL=file:$TESTTMP/a pulling from ../a searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files + 4:539e4b31b6dc + pretxnchangegroup.forbid hook: HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PENDING=$TESTTMP/b HG_SOURCE=pull HG_URL=file:$TESTTMP/a transaction abort! rollback completed abort: pretxnchangegroup.forbid1 hook exited with status 1 @@ -211,11 +211,11 @@ outgoing hooks can see env vars $ echo 'preoutgoing = python "$TESTDIR"/printenv.py preoutgoing' >> ../a/.hg/hgrc $ echo 'outgoing = python "$TESTDIR"/printenv.py outgoing' >> ../a/.hg/hgrc $ hg pull ../a - preoutgoing hook: HG_SOURCE=pull - outgoing hook: HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_SOURCE=pull pulling from ../a searching for changes + preoutgoing hook: HG_SOURCE=pull adding changesets + outgoing hook: HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_SOURCE=pull adding manifests adding file changes added 1 changesets with 1 changes to 1 files @@ -227,10 +227,10 @@ preoutgoing hook can prevent outgoing ch $ echo 'preoutgoing.forbid = python "$TESTDIR"/printenv.py preoutgoing.forbid 1' >> ../a/.hg/hgrc $ hg pull ../a + pulling from ../a + searching for changes preoutgoing hook: HG_SOURCE=pull preoutgoing.forbid hook: HG_SOURCE=pull - pulling from ../a - searching for changes abort: preoutgoing.forbid hook exited with status 1 [255] diff --git a/tests/test-http.t b/tests/test-http.t --- a/tests/test-http.t +++ b/tests/test-http.t @@ -76,12 +76,12 @@ pull $ echo '[hooks]' >> .hg/hgrc $ echo 'changegroup = python "$TESTDIR"/printenv.py changegroup' >> .hg/hgrc $ hg pull - changegroup hook: HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_URL=http://localhost:$HGPORT1/ pulling from http://localhost:$HGPORT1/ searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files + changegroup hook: HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_URL=http://localhost:$HGPORT1/ (run 'hg update' to get a working copy) $ cd .. diff --git a/tests/test-https.t b/tests/test-https.t --- a/tests/test-https.t +++ b/tests/test-https.t @@ -134,13 +134,13 @@ pull without cacert $ echo "changegroup = python '$TESTDIR'/printenv.py changegroup" >> .hg/hgrc $ hg pull 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) - changegroup hook: HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_URL=https://localhost:$HGPORT/ pulling from https://localhost:$HGPORT/ searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files + changegroup hook: HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_URL=https://localhost:$HGPORT/ 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) (run 'hg update' to get a working copy) $ cd .. diff --git a/tests/test-merge-symlinks.t b/tests/test-merge-symlinks.t --- a/tests/test-merge-symlinks.t +++ b/tests/test-merge-symlinks.t @@ -38,11 +38,11 @@ Merge them and display *_ISLINK vars merge heads $ hg merge --tool="python ../echo.py" + merging l HG_FILE l HG_MY_ISLINK 1 HG_OTHER_ISLINK 0 HG_BASE_ISLINK 0 - merging l 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) @@ -54,9 +54,9 @@ merge working directory 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg copy l l2 $ HGMERGE="python ../echo.py" hg up 3 + merging l2 HG_FILE l2 HG_MY_ISLINK 1 HG_OTHER_ISLINK 0 HG_BASE_ISLINK 0 - merging l2 0 files updated, 1 files merged, 0 files removed, 0 files unresolved diff --git a/tests/test-merge-tools.t b/tests/test-merge-tools.t --- a/tests/test-merge-tools.t +++ b/tests/test-merge-tools.t @@ -219,13 +219,13 @@ but true.executable set to cat found in true.executable=cat # hg update -C 1 # hg merge -r 2 + merging f revision 1 space revision 0 space revision 2 space - merging f 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) # cat f @@ -244,13 +244,13 @@ and true.executable set to cat with path true.executable=cat # hg update -C 1 # hg merge -r 2 --config merge-tools.true.executable=cat + merging f revision 1 space revision 0 space revision 2 space - merging f 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) # cat f @@ -598,6 +598,7 @@ Default is silent simplemerge: true.executable=cat # hg update -C 1 # hg merge -r 3 --config merge-tools.true.premerge=False + merging f revision 1 space revision 0 @@ -605,7 +606,6 @@ Default is silent simplemerge: revision 0 space revision 3 - merging f 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) # cat f @@ -631,6 +631,7 @@ Tool execution # hg update -C 1 $ hg merge -r 2 --config merge-tools.true.executable=head --config merge-tools.true.args='$base $local $other $output' \ > | sed 's,==> .* <==,==> ... <==,g' + merging f ==> ... <== revision 0 space @@ -646,7 +647,6 @@ Tool execution ==> ... <== revision 1 space - merging f 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ aftermerge @@ -757,13 +757,13 @@ cat is a bad merge-tool and doesn't chan true.executable=cat # hg update -C 1 # hg merge -y -r 2 --config merge-tools.true.checkchanged=1 + merging f revision 1 space revision 0 space revision 2 space - merging f output file f appears unchanged was merge successful (yn)? n merging f failed! diff --git a/tests/test-merge1.t b/tests/test-merge1.t --- a/tests/test-merge1.t +++ b/tests/test-merge1.t @@ -72,8 +72,8 @@ merge should fail [255] merge of b expected $ hg merge -f 1 + merging b merging for b - merging b 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg diff --nodates @@ -153,8 +153,8 @@ merge of b should fail [255] merge of b expected $ hg merge -f 2 + merging b merging for b - merging b 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg diff --nodates diff --git a/tests/test-patchbomb.t b/tests/test-patchbomb.t --- a/tests/test-patchbomb.t +++ b/tests/test-patchbomb.t @@ -159,12 +159,12 @@ $ hg email -m test.mbox -f quux -t foo -c bar -s test 0:tip \ > --config extensions.progress= --config progress.assume-tty=1 \ > --config progress.delay=0 --config progress.refresh=0 - \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) + This patch series consists of 2 patches. Write the introductory message for the patch series. - + \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) Writing [PATCH 0 of 2] test ... Writing [PATCH 1 of 2] a ... Writing [PATCH 2 of 2] b ... diff --git a/tests/test-pull-pull-corruption.t b/tests/test-pull-pull-corruption.t --- a/tests/test-pull-pull-corruption.t +++ b/tests/test-pull-pull-corruption.t @@ -42,10 +42,10 @@ start a pull... ... and start another pull before the first one has finished $ sleep 1 + pulling from ../source1 + requesting all changes $ hg pull ../source2 2>/dev/null pulling from ../source2 - pulling from ../source1 - requesting all changes adding changesets adding manifests adding file changes diff --git a/tests/test-static-http.t b/tests/test-static-http.t --- a/tests/test-static-http.t +++ b/tests/test-static-http.t @@ -68,13 +68,13 @@ check for HTTP opener failures when cach $ echo '[hooks]' >> .hg/hgrc $ echo 'changegroup = python "$TESTDIR"/printenv.py changegroup' >> .hg/hgrc $ hg pull - changegroup hook: HG_NODE=4ac2e3648604439c580c69b09ec9d93a88d93432 HG_SOURCE=pull HG_URL=http://localhost:$HGPORT/remote pulling from static-http://localhost:$HGPORT/remote searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files + changegroup hook: HG_NODE=4ac2e3648604439c580c69b09ec9d93a88d93432 HG_SOURCE=pull HG_URL=http://localhost:$HGPORT/remote (run 'hg update' to get a working copy) trying to push