Patchwork D7531: rust-matchers: add support for `exactmatcher` in `dirstate.status`

login
register
mail settings
Submitter phabricator
Date Dec. 12, 2019, 3:41 p.m.
Message ID <43292c5d2ccf9c4ca9a49df5f987241c@localhost.localdomain>
Download mbox | patch
Permalink /patch/43741/
State Not Applicable
Headers show

Comments

phabricator - Dec. 12, 2019, 3:41 p.m.
Alphare edited the summary of this revision.
Alphare retitled this revision from "rust-matchers: add support for `explicitmatcher` in `dirstate.status`" to "rust-matchers: add support for `exactmatcher` in `dirstate.status`".
Alphare updated this revision to Diff 18637.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7531?vs=18407&id=18637

BRANCH
  default

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7531/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7531

AFFECTED FILES
  mercurial/dirstate.py

CHANGE DETAILS




To: Alphare, #hg-reviewers
Cc: martinvonz, mercurial-devel

Patch

diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -1092,11 +1092,14 @@ 
         dmap.preload()
 
         use_rust = True
+
+        allowed_matchers = (matchmod.alwaysmatcher, matchmod.exactmatcher)
+
         if rustmod is None:
             use_rust = False
         elif subrepos:
             use_rust = False
-        if bool(listunknown):
+        elif bool(listunknown):
             # Pathauditor does not exist yet in Rust, unknown files
             # can't be trusted.
             use_rust = False
@@ -1104,7 +1107,7 @@ 
             # Rust has no ignore mechanism yet, so don't use Rust for
             # commands that need ignore.
             use_rust = False
-        elif not match.always():
+        elif not isinstance(match, allowed_matchers):
             # Matchers have yet to be implemented
             use_rust = False
 
@@ -1132,6 +1135,7 @@ 
                 clean,
             ) = rustmod.status(
                 dmap._rustmap,
+                match,
                 self._rootdir,
                 bool(listclean),
                 self._lastnormaltime,