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

login
register
mail settings
Submitter phabricator
Date Nov. 17, 2017, 10:29 p.m.
Message ID <5360948ce95e3b44946f95eee11352cb@localhost.localdomain>
Download mbox | patch
Permalink /patch/25630/
State Not Applicable
Headers show

Comments

phabricator - Nov. 17, 2017, 10:29 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG5d53247190d3: fsmonitor: only access inner dirstate map if it is available (authored by mbthomas, committed by ).

REPOSITORY
  rHG Mercurial

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

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