fsmonitor: only access inner dirstate map if it is available
As part of the dirstate refactor, fsmonitor was updated to directly access the
inner map of the dirstatemap object.
Dirstatemap reimplementations may not use a map like this, so only access it if
it is there.
Differential Revision: https://phab.mercurial-scm.org/D1346
--- a/hgext/fsmonitor/__init__.py Wed Nov 15 01:07:42 2017 -0800
+++ b/hgext/fsmonitor/__init__.py Wed Nov 15 01:07:42 2017 -0800
@@ -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