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
23730a47
Commit
23730a47
authored
15 years ago
by
Benoit Boissinot
Browse files
Options
Downloads
Patches
Plain Diff
inotify.server: the decorator eventaction() shouldn't be a method of repowatcher
parent
72af8005
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hgext/inotify/server.py
+18
-15
18 additions, 15 deletions
hgext/inotify/server.py
with
18 additions
and
15 deletions
hgext/inotify/server.py
+
18
−
15
View file @
23730a47
...
...
@@ -142,6 +142,24 @@
def
shutdown
(
self
):
raise
NotImplementedError
def
eventaction
(
code
):
"""
Decorator to help handle events in repowatcher
"""
def
decorator
(
f
):
def
wrapper
(
self
,
wpath
):
if
code
==
'
m
'
and
wpath
in
self
.
lastevent
and
\
self
.
lastevent
[
wpath
]
in
'
cm
'
:
return
self
.
lastevent
[
wpath
]
=
code
self
.
timeout
=
250
f
(
self
,
wpath
)
wrapper
.
func_name
=
f
.
func_name
return
wrapper
return
decorator
class
repowatcher
(
pollable
):
"""
Watches inotify events
...
...
@@ -439,21 +457,6 @@
self
.
statcache
.
pop
(
wpath
,
None
)
raise
def
eventaction
(
code
):
def
decorator
(
f
):
def
wrapper
(
self
,
wpath
):
if
code
==
'
m
'
and
wpath
in
self
.
lastevent
and
\
self
.
lastevent
[
wpath
]
in
'
cm
'
:
return
self
.
lastevent
[
wpath
]
=
code
self
.
timeout
=
250
f
(
self
,
wpath
)
wrapper
.
func_name
=
f
.
func_name
return
wrapper
return
decorator
@eventaction
(
'
c
'
)
def
created
(
self
,
wpath
):
if
wpath
==
'
.hgignore
'
:
...
...
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