yuja added a comment.
> Another point is that there is no firm guarantee that a valid revision
occurs before `NULL_REVISION`. I've found examples in `revlog.c` where the
second parent is (seemlingly on purpose) not ignored if the first is
`NULL_REVISION`, but I wouldn't want at this point to
> Another point is that there is no firm guarantee that a valid revision occurs
> before `NULL_REVISION`. I've found examples in `revlog.c` where the second
> parent is (seemlingly on purpose) not ignored if the first is
> `NULL_REVISION`, but I wouldn't want at this point to impose it from the
yuja added a comment.
Queued the first two, thanks.
> This is a nice improvement. It still seems odd to me to return a list of
two parents when there could be 0, 1 or 2 parents. I guess this is for
performance reasons?
It's a direct mapping from the revlog storage. I think `[Revis
Queued the first two, thanks.
> This is a nice improvement. It still seems odd to me to return a list of
> two parents when there could be 0, 1 or 2 parents. I guess this is for
> performance reasons?
It's a direct mapping from the revlog storage. I think `[Revision; 2]`
is good enough at thi
This revision was automatically updated to reflect the committed changes.
gracinet marked 2 inline comments as done.
Closed by commit rHGa6ba978d9ffb: rust: changed Graph.parents to return
[Revision; 2] (authored by gracinet, committed by ).
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
gracinet marked 2 inline comments as done.
gracinet added a subscriber: yuja.
gracinet added a comment.
Thanks ! About the fact to always returning two elements, I've been
hesitating about that. This is what the C function we're wrapping provides
anyway, so you could say it's for simplicity.
gracinet updated this revision to Diff 12831.
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D5415?vs=12828&id=12831
REVISION DETAIL
https://phab.mercurial-scm.org/D5415
AFFECTED FILES
rust/hg-core/src/ancestors.rs
rust/hg-core/src/lib.rs
rust/hg-d
kevincox added a comment.
This is a nice improvement. It still seems odd to me to return a list of two
parents when there could be 0, 1 or 2 parents. I guess this is for performance
reasons?
INLINE COMMENTS
> ancestors.rs:62
> +this.conditionally_push_rev(parents[0]);
> +
gracinet created this revision.
Herald added subscribers: mercurial-devel, kevincox, durin42.
Herald added a reviewer: hg-reviewers.
REVISION SUMMARY
This will allow for simple iteration on parent revisions,
such as:
for parent in graph.parents(rev)?.iter().cloned()
This seems to b