comparison tests/test-ssh-bundle1.t @ 26828:00e75baa810f stable

tests: add tests for remote hook output (issue4788) The added tests don't agree in their output. This demonstrates a difference in `hg push` behavior between pre-bundle2 and bundle2. A subsequent patch will attempt to restore some of the pre-bundle2 behavior to bundle2.
author Gregory Szorc <gregory.szorc@gmail.com>
date Sat, 24 Oct 2015 00:39:26 +0100
parents 7332bf4ae959
children 58f1645f72c3
comparison
equal deleted inserted replaced
26827:a9ed5a8fc5e0 26828:00e75baa810f
508 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio 508 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
509 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio 509 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
510 Got arguments 1:user@dummy 2:hg -R remote serve --stdio 510 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
511 changegroup-in-remote hook: HG_NODE=65c38f4125f9602c8db4af56530cc221d93b8ef8 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:ssh:127.0.0.1 (glob) 511 changegroup-in-remote hook: HG_NODE=65c38f4125f9602c8db4af56530cc221d93b8ef8 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:ssh:127.0.0.1 (glob)
512 Got arguments 1:user@dummy 2:hg -R remote serve --stdio 512 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
513
514 remote hook failure is attributed to remote
515
516 $ cat > $TESTTMP/failhook << EOF
517 > def hook(ui, repo, **kwargs):
518 > ui.write('hook failure!\n')
519 > ui.flush()
520 > return 1
521 > EOF
522
523 $ echo "pretxnchangegroup.fail = python:$TESTTMP/failhook:hook" >> remote/.hg/hgrc
524
525 $ hg -q --config ui.ssh="python '$TESTDIR/dummyssh'" clone ssh://user@dummy/remote hookout
526 $ cd hookout
527 $ touch hookfailure
528 $ hg -q commit -A -m 'remote hook failure'
529 $ hg --config ui.ssh="python '$TESTDIR/dummyssh'" push
530 pushing to ssh://user@dummy/remote
531 searching for changes
532 remote: adding changesets
533 remote: adding manifests
534 remote: adding file changes
535 remote: added 1 changesets with 1 changes to 1 files
536 remote: hook failure!transaction abort!
537 remote: rollback completed
538 remote: abort: pretxnchangegroup.fail hook failed
539 [1]
540