mercurial/dirstate.py
changeset 43274 733d4ffcd667
parent 43239 6fcdcea2b03a
child 43280 5d4046594d6f
equal deleted inserted replaced
43273:478d0b1bf0c5 43274:733d4ffcd667
    25     match as matchmod,
    25     match as matchmod,
    26     pathutil,
    26     pathutil,
    27     policy,
    27     policy,
    28     pycompat,
    28     pycompat,
    29     scmutil,
    29     scmutil,
       
    30     sparse,
    30     txnutil,
    31     txnutil,
    31     util,
    32     util,
    32 )
    33 )
    33 
    34 
    34 from .interfaces import (
    35 from .interfaces import (
  1095         lookup, modified, added, unknown, ignored = [], [], [], [], []
  1096         lookup, modified, added, unknown, ignored = [], [], [], [], []
  1096         removed, deleted, clean = [], [], []
  1097         removed, deleted, clean = [], [], []
  1097 
  1098 
  1098         dmap = self._map
  1099         dmap = self._map
  1099         dmap.preload()
  1100         dmap.preload()
       
  1101 
       
  1102         use_rust = True
       
  1103         if rustmod is None:
       
  1104             use_rust = False
       
  1105         elif subrepos:
       
  1106             use_rust = False
       
  1107         if bool(listunknown):
       
  1108             # Pathauditor does not exist yet in Rust, unknown files
       
  1109             # can't be trusted.
       
  1110             use_rust = False
       
  1111         elif self._ignorefiles() and listignored:
       
  1112             # Rust has no ignore mechanism yet, so don't use Rust for
       
  1113             # commands that need ignore.
       
  1114             use_rust = False
       
  1115         elif not match.always():
       
  1116             # Matchers have yet to be implemented
       
  1117             use_rust = False
       
  1118         # We don't yet have a mechanism for extensions
       
  1119         elif sparse.enabled:
       
  1120             use_rust = False
       
  1121         elif not getattr(self, "_fsmonitordisable", True):
       
  1122             use_rust = False
       
  1123 
       
  1124         if use_rust:
       
  1125             (
       
  1126                 lookup,
       
  1127                 modified,
       
  1128                 added,
       
  1129                 removed,
       
  1130                 deleted,
       
  1131                 unknown,
       
  1132                 clean,
       
  1133             ) = rustmod.status(
       
  1134                 dmap._rustmap,
       
  1135                 self._rootdir,
       
  1136                 match.files(),
       
  1137                 bool(listclean),
       
  1138                 self._lastnormaltime,
       
  1139                 self._checkexec,
       
  1140             )
       
  1141 
       
  1142             status = scmutil.status(
       
  1143                 modified=modified,
       
  1144                 added=added,
       
  1145                 removed=removed,
       
  1146                 deleted=deleted,
       
  1147                 unknown=unknown,
       
  1148                 ignored=ignored,
       
  1149                 clean=clean,
       
  1150             )
       
  1151             return (lookup, status)
       
  1152 
  1100         dcontains = dmap.__contains__
  1153         dcontains = dmap.__contains__
  1101         dget = dmap.__getitem__
  1154         dget = dmap.__getitem__
  1102         ladd = lookup.append  # aka "unsure"
  1155         ladd = lookup.append  # aka "unsure"
  1103         madd = modified.append
  1156         madd = modified.append
  1104         aadd = added.append
  1157         aadd = added.append