# HG changeset patch # User Laurent Charignon # Date 2015-12-22 00:22:43 # Node ID 714849ba7836db4fc6247688b320360a2f88e0b1 # Parent c8dc480142a82863741990fb3293d99c28429c03 dirstate: add a function to compute non-normal entries from the dmap This patch adds a new python function in the dirstate to compute the set of non-normal files from the dmap. These files are useful to compute the repository status. diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py --- a/mercurial/dirstate.py +++ b/mercurial/dirstate.py @@ -49,6 +49,11 @@ def _getfsnow(vfs): os.close(tmpfd) vfs.unlink(tmpname) +def nonnormalentries(dmap): + '''Compute the nonnormal dirstate entries from the dmap''' + return set(fname for fname, e in dmap.iteritems() + if e[0] != 'n' or e[3] == -1) + def _trypending(root, vfs, filename): '''Open file to be read according to HG_PENDING environment variable