# HG changeset patch # User Tony Tung # Date 2016-05-02 22:22:16 # Node ID e2178f7d17c01fcd5a60b7c2a3f016f1d464c8cf # Parent 4a65c9c6cd3fdd8e56a366dd16a8bc138f2e0ad6 manifest: improve filesnotin performance by using lazymanifest diff lazymanifests can compute diffs significantly faster than taking the set of two manifests and calculating the delta. when running hg diff --git -c . on Facebook's big repo, this reduces the run time from 2.1s to 1.5s. diff --git a/mercurial/manifest.py b/mercurial/manifest.py --- a/mercurial/manifest.py +++ b/mercurial/manifest.py @@ -211,8 +211,10 @@ class manifestdict(object): def filesnotin(self, m2): '''Set of files in this manifest that are not in the other''' - files = set(self) - files.difference_update(m2) + diff = self.diff(m2) + files = set(filepath + for filepath, hashflags in diff.iteritems() + if hashflags[1][0] is None) return files @propertycache