Patchwork D1346: fsmonitor: only access inner dirstate map if it is available

login
register
mail settings
Submitter phabricator
Date Nov. 15, 2017, 9:08 a.m.
Message ID <67f63ee8fd0f38e71277a2ac2e19ceb1@localhost.localdomain>
Download mbox | patch
Permalink /patch/25572/
State Not Applicable
Headers show

Comments

phabricator - Nov. 15, 2017, 9:08 a.m.
mbthomas updated this revision to Diff 3520.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1346?vs=3346&id=3520

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

AFFECTED FILES
  hgext/fsmonitor/__init__.py

CHANGE DETAILS




To: mbthomas, #hg-reviewers, durin42
Cc: durin42, mercurial-devel

Patch

diff --git a/hgext/fsmonitor/__init__.py b/hgext/fsmonitor/__init__.py
--- a/hgext/fsmonitor/__init__.py
+++ b/hgext/fsmonitor/__init__.py
@@ -273,7 +273,11 @@ 
 
     matchfn = match.matchfn
     matchalways = match.always()
-    dmap = self._map._map
+    dmap = self._map
+    if util.safehasattr(dmap, '_map'):
+        # for better performance, directly access the inner dirstate map if the
+        # standard dirstate implementation is in use.
+        dmap = dmap._map
     nonnormalset = self._map.nonnormalset
 
     copymap = self._map.copymap