# HG changeset patch # User Jun Wu # Date 1508366564 25200 # Node ID 2e350d2a0ecaaa8b98b36fd685feccf427634a8d # Parent 97017508c86306a4eebe8e441c96629186d2e359 fsmonitor: use nonnormalset from dirstatemap `dirstate._nonnormalset` has been moved to `dirstate._map.nonnormalset` by 60927b19ed65 (dirstate: move nonnormal and otherparent sets to dirstatemap) and is guaranteed to be existed. Let's update fsmonitor code to use the new `nonnormalset`. Thix fixed a perf regression that slows down `hg status` by 0.5 seconds in one of our production repos. Differential Revision: https://phab.mercurial-scm.org/D1184 diff -r 97017508c863 -r 2e350d2a0eca hgext/fsmonitor/__init__.py --- a/hgext/fsmonitor/__init__.py Wed Oct 18 22:10:08 2017 -0700 +++ b/hgext/fsmonitor/__init__.py Wed Oct 18 15:42:44 2017 -0700 @@ -274,7 +274,7 @@ matchfn = match.matchfn matchalways = match.always() dmap = self._map._map - nonnormalset = getattr(self, '_nonnormalset', None) + nonnormalset = self._map.nonnormalset copymap = self._map.copymap getkind = stat.S_IFMT @@ -404,7 +404,7 @@ visit = set((f for f in notefiles if (f not in results and matchfn(f) and (f in dmap or not ignore(f))))) - if nonnormalset is not None and not fresh_instance: + if not fresh_instance: if matchalways: visit.update(f for f in nonnormalset if f not in results) visit.update(f for f in copymap if f not in results) @@ -415,15 +415,11 @@ if f not in results and matchfn(f)) else: if matchalways: - visit.update(f for f, st in dmap.iteritems() - if (f not in results and - (st[2] < 0 or st[0] != 'n' or fresh_instance))) + visit.update(f for f, st in dmap.iteritems() if f not in results) visit.update(f for f in copymap if f not in results) else: visit.update(f for f, st in dmap.iteritems() - if (f not in results and - (st[2] < 0 or st[0] != 'n' or fresh_instance) - and matchfn(f))) + if f not in results and matchfn(f)) visit.update(f for f in copymap if f not in results and matchfn(f))