Mercurial > public > mercurial-scm > hg
diff mercurial/repoview.py @ 51259:f20c4b307a5a
rust-index: add fast-path for getting a list of all heads as nodes
This avoids a lot of back-and-forth between Python and Rust. We forgo adding
a fast-path in the `filteredchangelog` case yet. If it shows up in profiling,
we might add the variant with a filter.
author | Rapha?l Gom?s <rgomes@octobus.net> |
---|---|
date | Tue, 05 Dec 2023 14:50:05 +0100 |
parents | 1c0f3994d733 |
children | f8bf1a8e9181 |
line wrap: on
line diff
--- a/mercurial/repoview.py Wed Nov 29 23:22:51 2023 -0500 +++ b/mercurial/repoview.py Tue Dec 05 14:50:05 2023 +0100 @@ -305,6 +305,10 @@ raise error.FilteredIndexError(rev) return revs + def _head_node_ids(self): + # no Rust fast path implemented yet, so just loop in Python + return [self.node(r) for r in self.headrevs()] + def headrevs(self, revs=None): if revs is None: try: