Mercurial > public > mercurial-scm > hg-stable
diff rust/hg-core/src/lib.rs @ 40972:d097dd0afc19
rust: translation of missingancestors
This is as direct as possible a translation of the ancestor.missingancestors
Python class in pure Rust. The goal for this changeset is to make it easy
to compare with the Python version.
We also add to Python tests the cases that helped us develop and debug
this implementation.
Some possible optimizations are marked along the way as TODO comments
Differential Revision: https://phab.mercurial-scm.org/D5416
author | Georges Racinet <gracinet@anybox.fr> |
---|---|
date | Fri, 30 Nov 2018 00:46:55 +0100 |
parents | 18513d6ef7d4 |
children | ef54bd33b476 |
line wrap: on
line diff
--- a/rust/hg-core/src/lib.rs Fri Dec 14 18:15:19 2018 +0100 +++ b/rust/hg-core/src/lib.rs Fri Nov 30 00:46:55 2018 +0100 @@ -3,7 +3,7 @@ // This software may be used and distributed according to the terms of the // GNU General Public License version 2 or any later version. mod ancestors; -pub use ancestors::AncestorsIterator; +pub use ancestors::{AncestorsIterator, MissingAncestors}; /// Mercurial revision numbers /// @@ -15,6 +15,9 @@ /// The simplest expression of what we need of Mercurial DAGs. pub trait Graph { + /// Return the two parents of the given `Revision`. + /// + /// Each of the parents can be independently `NULL_REVISION` fn parents(&self, Revision) -> Result<[Revision; 2], GraphError>; }