[PATCH stable] inotify: ignore temporary files created by util.check(exec|link)

Benoit Boissinot bboissin at gmail.com
Wed Apr 14 04:06:44 CDT 2010


On Wed, Apr 14, 2010 at 11:02 AM, Nicolas Dumazet <nicdumz at gmail.com> wrote:
> # HG changeset patch
> # User Nicolas Dumazet <nicdumz.commits at gmail.com>
> # Date 1271230284 -32400
> # Node ID 428bef22c4a4dc642437b23740fff34fd60f69a3
> # Parent  cd21bf199d17681770552d1be9074caf691528ca
> inotify: ignore temporary files created by util.check(exec|link)

can you explain what happens if they aren't ignored? besides a bit
more processing and a (short) window where they might appear in hg
status?

>
> diff --git a/hgext/inotify/linuxserver.py b/hgext/inotify/linuxserver.py
> --- a/hgext/inotify/linuxserver.py
> +++ b/hgext/inotify/linuxserver.py
> @@ -332,6 +332,12 @@
>         if self.ui.debugflag:
>             self.ui.note(_('%s reading %d events\n') %
>                          (self.event_time(), len(events)))
> +
> +        # Ignore temporary files handled by util.check(exec|link)
> +        checkprefixes = ('hg-checkexec-', 'hg-checklink-',)
> +        # The two prefixes have the same length
> +        checkprefixlen = len(checkprefixes[0])

that looks bug-prone if a new temp file is added with a different prefix length.


More information about the Mercurial-devel mailing list