##// END OF EJS Templates
tests: add tests for remote hook output (issue4788)...
Gregory Szorc -
r26828:00e75baa stable
parent child Browse files
Show More
@@ -510,3 +510,31 b' debug output'
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
@@ -501,3 +501,32 b' debug output'
501 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
501 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
502 changegroup-in-remote hook: HG_BUNDLE2=1 HG_NODE=65c38f4125f9602c8db4af56530cc221d93b8ef8 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:ssh:127.0.0.1 (glob)
502 changegroup-in-remote hook: HG_BUNDLE2=1 HG_NODE=65c38f4125f9602c8db4af56530cc221d93b8ef8 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:ssh:127.0.0.1 (glob)
503 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
503 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
504
505 remote hook failure is attributed to remote
506
507 $ cat > $TESTTMP/failhook << EOF
508 > def hook(ui, repo, **kwargs):
509 > ui.write('hook failure!\n')
510 > ui.flush()
511 > return 1
512 > EOF
513
514 $ echo "pretxnchangegroup.fail = python:$TESTTMP/failhook:hook" >> remote/.hg/hgrc
515
516 $ hg -q --config ui.ssh="python '$TESTDIR/dummyssh'" clone ssh://user@dummy/remote hookout
517 $ cd hookout
518 $ touch hookfailure
519 $ hg -q commit -A -m 'remote hook failure'
520 $ hg --config ui.ssh="python '$TESTDIR/dummyssh'" push
521 pushing to ssh://user@dummy/remote
522 searching for changes
523 remote: adding changesets
524 remote: adding manifests
525 remote: adding file changes
526 remote: added 1 changesets with 1 changes to 1 files
527 remote: hook failure!
528 remote: transaction abort!
529 remote: rollback completed
530 abort: pretxnchangegroup.fail hook failed
531 [255]
532
General Comments 0
You need to be logged in to leave comments. Login now