[PATCH] fsmonitor: use modern match API

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] fsmonitor: use modern match API

Martin von Zweigbergk via Mercurial-devel
# HG changeset patch
# User Martin von Zweigbergk <[hidden email]>
# Date 1495090483 25200
#      Wed May 17 23:54:43 2017 -0700
# Node ID 64ac7ed2ee4e9b3fe99bc3bec68191ded607e896
# Parent  0d6b3572ad924103128bb9cd296000fc6fd821ef
fsmonitor: use modern match API

It seems like fsmonitor/__init__.py was based on a pretty old version
of dirstate.py. Let's copy over the changes from the following two
commits:

55c449345b10 (match: add isexact() method to hide internals, 2014-10-29)
3c346969c321 (dirstate: avoid match.files() in walk(), 2015-05-19)

diff --git a/hgext/fsmonitor/__init__.py b/hgext/fsmonitor/__init__.py
--- a/hgext/fsmonitor/__init__.py
+++ b/hgext/fsmonitor/__init__.py
@@ -253,10 +253,10 @@
     fresh_instance = False
 
     exact = skipstep3 = False
-    if matchfn == match.exact:  # match.exact
+    if match.isexact():  # match.exact
         exact = True
         dirignore = util.always  # skip step 2
-    elif match.files() and not match.anypats():  # match.match, no patterns
+    elif match.prefix():  # match.match, no patterns
         skipstep3 = True
 
     if not exact and self._checkcase:
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] fsmonitor: use modern match API

Yuya Nishihara
On Thu, 18 May 2017 09:13:29 -0700, Martin von Zweigbergk via Mercurial-devel wrote:
> # HG changeset patch
> # User Martin von Zweigbergk <[hidden email]>
> # Date 1495090483 25200
> #      Wed May 17 23:54:43 2017 -0700
> # Node ID 64ac7ed2ee4e9b3fe99bc3bec68191ded607e896
> # Parent  0d6b3572ad924103128bb9cd296000fc6fd821ef
> fsmonitor: use modern match API

Looks good. Queued, thanks.
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel