mirror of
https://github.com/facebook/sapling.git
synced 2024-12-28 15:44:27 +03:00
changelog: tonodes(idset) has a fast path
Summary: By default, `torevs` calls Python iteration for non-list, non-spans Python objects. The `idset` object has the `spans` which can be used as a fast path. Reviewed By: DurhamG Differential Revision: D22970580 fbshipit-source-id: f491404ba803c4468c17cd74daaea90f46b8b38b
This commit is contained in:
parent
1649714542
commit
e5d816c812
@ -17,6 +17,7 @@ from . import (
|
||||
mdiff,
|
||||
progress,
|
||||
revlog,
|
||||
smartset,
|
||||
util,
|
||||
visibility,
|
||||
)
|
||||
@ -147,10 +148,12 @@ class changelog(object):
|
||||
"""
|
||||
return self.inner.torevs
|
||||
|
||||
@property
|
||||
def tonodes(self):
|
||||
def tonodes(self, revs):
|
||||
"""Convert an IdSet to Set. The reverse of torevs."""
|
||||
return self.inner.tonodes
|
||||
# 'idset' has a fast path - pass the Rust-binding 'spans' directly.
|
||||
if isinstance(revs, smartset.idset):
|
||||
return self.inner.tonodes(revs._spans)
|
||||
return self.inner.tonodes(revs)
|
||||
|
||||
def _loadvisibleheads(self, svfs):
|
||||
return visibility.visibleheads(svfs)
|
||||
|
Loading…
Reference in New Issue
Block a user