comparison mercurial/revlog.py @ 17971:e1b9a78a7aed

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.
author Siddharth Agarwal <sid0@fb.com>
date Mon, 26 Nov 2012 11:02:48 -0800
parents 6f79c32c0bdf
children 7ef00d09ef35
comparison
equal deleted inserted replaced
17970:0b03454abae7 17971:e1b9a78a7aed
442 topologically sorted. 442 topologically sorted.
443 443
444 'heads' and 'common' are both lists of node IDs. If heads is 444 'heads' and 'common' are both lists of node IDs. If heads is
445 not supplied, uses all of the revlog's heads. If common is not 445 not supplied, uses all of the revlog's heads. If common is not
446 supplied, uses nullid.""" 446 supplied, uses nullid."""
447 _common, missing = self.findcommonmissing(common, heads) 447 if common is None:
448 return missing 448 common = [nullid]
449 if heads is None:
450 heads = self.heads()
451
452 common = [self.rev(n) for n in common]
453 heads = [self.rev(n) for n in heads]
454
455 return [self.node(r) for r in
456 ancestor.missingancestors(heads, common, self.parentrevs)]
449 457
450 def nodesbetween(self, roots=None, heads=None): 458 def nodesbetween(self, roots=None, heads=None):
451 """Return a topological path from 'roots' to 'heads'. 459 """Return a topological path from 'roots' to 'heads'.
452 460
453 Return a tuple (nodes, outroots, outheads) where 'nodes' is a 461 Return a tuple (nodes, outroots, outheads) where 'nodes' is a