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
a930d66a04af
Commit
a930d66a04af
authored
9 years ago
by
Siddharth Agarwal
Browse files
Options
Downloads
Patches
Plain Diff
hook: factor out determination of hooks from running them
This will allow other code to run a predetermined series of hooks.
parent
143b52fce68e
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mercurial/hook.py
+9
-4
9 additions, 4 deletions
mercurial/hook.py
with
9 additions
and
4 deletions
mercurial/hook.py
+
9
−
4
View file @
a930d66a
...
...
@@ -162,7 +162,15 @@
if
not
ui
.
callhooks
:
return
False
hooks
=
[]
for
hname
,
cmd
in
_allhooks
(
ui
):
if
hname
.
split
(
'
.
'
)[
0
]
==
name
and
cmd
:
hooks
.
append
((
hname
,
cmd
))
return
runhooks
(
ui
,
repo
,
name
,
hooks
,
throw
=
throw
,
**
args
)
def
runhooks
(
ui
,
repo
,
name
,
hooks
,
throw
=
False
,
**
args
):
r
=
False
oldstdout
=
-
1
try
:
...
...
@@ -165,11 +173,8 @@
r
=
False
oldstdout
=
-
1
try
:
for
hname
,
cmd
in
_allhooks
(
ui
):
if
hname
.
split
(
'
.
'
)[
0
]
!=
name
or
not
cmd
:
continue
for
hname
,
cmd
in
hooks
:
if
oldstdout
==
-
1
and
_redirect
:
try
:
stdoutno
=
sys
.
__stdout__
.
fileno
()
...
...
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