# HG changeset patch # User Siddharth Agarwal # Date 1353956568 28800 # Node ID e1b9a78a7aedc96f52ef5cdd6ee424dba079b4a2 # Parent 0b03454abae74d20c0a2f7c8750e8210fc72bddf revlog: switch findmissing to use ancestor.missingancestors This also speeds up other commands that use findmissing, like incoming and merge --preview. With a large linear repository (>400000 commits) and with one incoming changeset, incoming is sped up from around 4-4.5 seconds to under 3. diff -r 0b03454abae7 -r e1b9a78a7aed mercurial/revlog.py --- a/mercurial/revlog.py Mon Nov 26 11:46:51 2012 -0800 +++ b/mercurial/revlog.py Mon Nov 26 11:02:48 2012 -0800 @@ -444,8 +444,16 @@ 'heads' and 'common' are both lists of node IDs. If heads is not supplied, uses all of the revlog's heads. If common is not supplied, uses nullid.""" - _common, missing = self.findcommonmissing(common, heads) - return missing + if common is None: + common = [nullid] + if heads is None: + heads = self.heads() + + common = [self.rev(n) for n in common] + heads = [self.rev(n) for n in heads] + + return [self.node(r) for r in + ancestor.missingancestors(heads, common, self.parentrevs)] def nodesbetween(self, roots=None, heads=None): """Return a topological path from 'roots' to 'heads'.