Commit Graph

2 Commits

Author SHA1 Message Date
Fintan Halpenny 54d23545ff
radicle: port quorum code to Canonical
Remove the old `quorum` function in favour of using the newly introduced
`Canonical` code. Port over the tests to use the `Canonical` type. The change is
minimised by introducing a helper function called `quorum` in the test module
that acts like the old function.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-07-03 15:10:43 +01:00
Fintan Halpenny 7fd9c3be8f
radicle: introduce Canonical type
Introduces a type, `Canonical`, to make manipulating and calculating canonical
reference quorum's easier.

The idea is that the type can be constructed by providing a set of delegates and
the reference name for which the calculations are referencing. It can construct
the set of tips and can output the quourum.

It provides a shortcut for constructing the `default_branch` set of tips.

It also provides some extra methods for helping in quorum calculations that will
be used within the remote helper code.

Note that this does not yet replace the `quorum` function in the `git` module --
this is to help minimise the review of this commit.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-07-03 15:09:38 +01:00