# HG changeset patch # User Mark Thomas # Date 1510736862 28800 # Node ID ae7ad53d3c8d92049a63816786c2c8c7f7c175d9 # Parent 61888bd0b3005e34a032756495fc384f95a6e302 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 diff -r 61888bd0b300 -r ae7ad53d3c8d hgext/fsmonitor/__init__.py --- 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