Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
mercurial-devel
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mercurial
mercurial-devel
Commits
88e309a0c133
Commit
88e309a0c133
authored
9 years ago
by
Siddharth Agarwal
Browse files
Options
Downloads
Patches
Plain Diff
hook: add tests for failing post- python hooks
I couldn't find any tests for this.
parent
cedbe8723d99
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test-hook.t
+39
-0
39 additions, 0 deletions
tests/test-hook.t
with
39 additions
and
0 deletions
tests/test-hook.t
+
39
−
0
View file @
88e309a0
...
...
@@ -532,6 +532,45 @@
adding remote bookmark quux
(run
'
hg
update
'
to get a working copy)
post- python hooks that fail to *run* don
'
t
cause
an
abort
$
rm
..
/a/
.
hg
/
hgrc
$
echo
'
[hooks]
'
>
.
hg
/
hgrc
$
echo
'
post-pull.broken = python:hooktests.brokenhook
'
>>
.
hg
/
hgrc
$
hg
pull
../
a
pulling
from
../
a
searching
for
changes
no
changes
found
error:
post
-
pull
.
broken
hook
raised
an
exception:
unsupported
operand
type
(
s) for +: 'int' and 'dict'
but post- python hooks that fail to *load* do
$ echo '[hooks]' > .hg/hgrc
$ echo 'post-pull.nomodule = python:nomodule' >> .hg/hgrc
$ hg pull ../a
pulling from ../a
searching for changes
no changes found
abort: post-pull.nomodule hook is invalid: "nomodule" not in a module
[255]
$ echo '[hooks]' > .hg/hgrc
$ echo 'post-pull.badmodule = python:nomodule.nowhere' >> .hg/hgrc
$ hg pull ../a
pulling from ../a
searching for changes
no changes found
abort: post-pull.badmodule hook is invalid: import of "nomodule" failed
(run with --traceback for stack trace)
[255]
$ echo '[hooks]' > .hg/hgrc
$ echo 'post-pull.nohook = python:hooktests.nohook' >> .hg/hgrc
$ hg pull ../a
pulling from ../a
searching for changes
no changes found
abort: post-pull.nohook hook is invalid: "hooktests.nohook" is not defined
[255]
make sure --traceback works
$ echo '[hooks]' > .hg/hgrc
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment