Mercurial > hg
changeset 35085:ae7ad53d3c8d
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
author | Mark Thomas <mbthomas@fb.com> |
---|---|
date | Wed, 15 Nov 2017 01:07:42 -0800 |
parents | 61888bd0b300 |
children | 8db4ca768416 |
files | hgext/fsmonitor/__init__.py |
diffstat | 1 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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