Skip to content
Snippets Groups Projects
Commit 89ce6a49 authored by Georges Racinet's avatar Georges Racinet
Browse files

rust-index: implement common_ancestors_heads() and ancestors()

The only differences betwwen `common_ancestors_heads()` and
`find_gca_candidates()` seems to be that:

- the former accepts "overlapping" input revisions (meaning with duplicates).
- limitation to 24 inputs (in the C code), that we translate to using the
  arbitrary size bit sets in the Rust code because we cannot bail to Python.

Given that the input is expected to be small in most cases, we take the
heavy handed approach of going through a HashSet and wait for perfomance
assessment

In case this is used via `hg-cpython`, we can anyway absorb the overhead
by having `commonancestorheads` build a vector of unique values
directly, and introduce a thin wrapper over `find_gca_candidates`, to take
care of bit set type dispatching only.

As far as `ancestors` is concerneed, this is just chaining
`common_ancestors_heads()` with `find_deepest_revs`.
parent 43241f31
No related branches found
No related tags found
2 merge requests!737Improvements to the Rust index's performance,!708Implement pure rust revlog Index
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment