comparison tests/test-hook.t @ 28079:0c9e914029be

hook: fewer parentheses for hook load errors This matches 'hook failed' warnings. We're also going to add hints to some of the hook load errors. Without this change we'd have two pairs of parens for a single error message, which looks really cluttered.
author Siddharth Agarwal <sid0@fb.com>
date Thu, 11 Feb 2016 22:41:20 -0800
parents 24361fb68cba
children 37b818cad146
comparison
equal deleted inserted replaced
28078:2058e1a894f2 28079:0c9e914029be
478 $ echo '[hooks]' > ../a/.hg/hgrc 478 $ echo '[hooks]' > ../a/.hg/hgrc
479 $ echo 'preoutgoing.uncallable = python:hooktests.uncallable' >> ../a/.hg/hgrc 479 $ echo 'preoutgoing.uncallable = python:hooktests.uncallable' >> ../a/.hg/hgrc
480 $ hg pull ../a 480 $ hg pull ../a
481 pulling from ../a 481 pulling from ../a
482 searching for changes 482 searching for changes
483 abort: preoutgoing.uncallable hook is invalid ("hooktests.uncallable" is not callable) 483 abort: preoutgoing.uncallable hook is invalid: "hooktests.uncallable" is not callable
484 [255] 484 [255]
485 485
486 $ echo '[hooks]' > ../a/.hg/hgrc 486 $ echo '[hooks]' > ../a/.hg/hgrc
487 $ echo 'preoutgoing.nohook = python:hooktests.nohook' >> ../a/.hg/hgrc 487 $ echo 'preoutgoing.nohook = python:hooktests.nohook' >> ../a/.hg/hgrc
488 $ hg pull ../a 488 $ hg pull ../a
489 pulling from ../a 489 pulling from ../a
490 searching for changes 490 searching for changes
491 abort: preoutgoing.nohook hook is invalid ("hooktests.nohook" is not defined) 491 abort: preoutgoing.nohook hook is invalid: "hooktests.nohook" is not defined
492 [255] 492 [255]
493 493
494 $ echo '[hooks]' > ../a/.hg/hgrc 494 $ echo '[hooks]' > ../a/.hg/hgrc
495 $ echo 'preoutgoing.nomodule = python:nomodule' >> ../a/.hg/hgrc 495 $ echo 'preoutgoing.nomodule = python:nomodule' >> ../a/.hg/hgrc
496 $ hg pull ../a 496 $ hg pull ../a
502 $ echo '[hooks]' > ../a/.hg/hgrc 502 $ echo '[hooks]' > ../a/.hg/hgrc
503 $ echo 'preoutgoing.badmodule = python:nomodule.nowhere' >> ../a/.hg/hgrc 503 $ echo 'preoutgoing.badmodule = python:nomodule.nowhere' >> ../a/.hg/hgrc
504 $ hg pull ../a 504 $ hg pull ../a
505 pulling from ../a 505 pulling from ../a
506 searching for changes 506 searching for changes
507 abort: preoutgoing.badmodule hook is invalid (import of "nomodule" failed) 507 abort: preoutgoing.badmodule hook is invalid: import of "nomodule" failed
508 [255] 508 [255]
509 509
510 $ echo '[hooks]' > ../a/.hg/hgrc 510 $ echo '[hooks]' > ../a/.hg/hgrc
511 $ echo 'preoutgoing.unreachable = python:hooktests.container.unreachable' >> ../a/.hg/hgrc 511 $ echo 'preoutgoing.unreachable = python:hooktests.container.unreachable' >> ../a/.hg/hgrc
512 $ hg pull ../a 512 $ hg pull ../a
513 pulling from ../a 513 pulling from ../a
514 searching for changes 514 searching for changes
515 abort: preoutgoing.unreachable hook is invalid (import of "hooktests.container" failed) 515 abort: preoutgoing.unreachable hook is invalid: import of "hooktests.container" failed
516 [255] 516 [255]
517 517
518 $ echo '[hooks]' > ../a/.hg/hgrc 518 $ echo '[hooks]' > ../a/.hg/hgrc
519 $ echo 'preoutgoing.pass = python:hooktests.passhook' >> ../a/.hg/hgrc 519 $ echo 'preoutgoing.pass = python:hooktests.passhook' >> ../a/.hg/hgrc
520 $ hg pull ../a 520 $ hg pull ../a
626 ImportError: No module named somebogusmodule 626 ImportError: No module named somebogusmodule
627 exception from second failed import attempt: 627 exception from second failed import attempt:
628 Traceback (most recent call last): 628 Traceback (most recent call last):
629 ImportError: No module named hgext_importfail 629 ImportError: No module named hgext_importfail
630 Traceback (most recent call last): 630 Traceback (most recent call last):
631 HookLoadError: precommit.importfail hook is invalid (import of "importfail" failed) 631 HookLoadError: precommit.importfail hook is invalid: import of "importfail" failed
632 abort: precommit.importfail hook is invalid (import of "importfail" failed) 632 abort: precommit.importfail hook is invalid: import of "importfail" failed
633 633
634 Issue1827: Hooks Update & Commit not completely post operation 634 Issue1827: Hooks Update & Commit not completely post operation
635 635
636 commit and update hooks should run after command completion. The largefiles 636 commit and update hooks should run after command completion. The largefiles
637 use demonstrates a recursive wlock, showing the hook doesn't run until the 637 use demonstrates a recursive wlock, showing the hook doesn't run until the