diff mercurial/manifest.py @ 16646:a1dcd842ce17

localrepo: optimize internode status calls using withflags Introduce manifestdict.withflags() to get a set of all files which have any flags set, since these are likely to be a minority. Otherwise checking .flags() for every file is a lot of dictionary lookups and is quite slow.
author Jesse Glick <jesse.glick@oracle.com>
date Fri, 04 May 2012 15:56:45 -0400
parents d976b1ef6760
children 525fdb738975
line wrap: on
line diff
--- a/mercurial/manifest.py	Fri May 04 15:54:55 2012 -0400
+++ b/mercurial/manifest.py	Fri May 04 15:56:45 2012 -0400
@@ -19,6 +19,8 @@
         self._flags = flags
     def flags(self, f):
         return self._flags.get(f, "")
+    def withflags(self):
+        return set(self._flags.keys())
     def set(self, f, flags):
         self._flags[f] = flags
     def copy(self):