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

mbthomas (Mark Thomas) phabricator at mercurial-scm.org
Fri Nov 17 17:29:07 EST 2017


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

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



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


More information about the Mercurial-devel mailing list