D5415: rust: changed Graph.parents to return [Revision; 2]

2018-12-13 Thread yuja (Yuya Nishihara)
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

Re: D5415: rust: changed Graph.parents to return [Revision; 2]

2018-12-13 Thread Yuya Nishihara
> 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

D5415: rust: changed Graph.parents to return [Revision; 2]

2018-12-13 Thread yuja (Yuya Nishihara)
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

Re: D5415: rust: changed Graph.parents to return [Revision; 2]

2018-12-13 Thread Yuya Nishihara
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

D5415: rust: changed Graph.parents to return [Revision; 2]

2018-12-13 Thread gracinet (Georges Racinet)
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

D5415: rust: changed Graph.parents to return [Revision; 2]

2018-12-12 Thread gracinet (Georges Racinet)
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.

D5415: rust: changed Graph.parents to return [Revision; 2]

2018-12-12 Thread gracinet (Georges Racinet)
gracinet updated this revision to Diff 12831. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5415?vs=12828=12831 REVISION DETAIL https://phab.mercurial-scm.org/D5415 AFFECTED FILES rust/hg-core/src/ancestors.rs rust/hg-core/src/lib.rs

D5415: rust: changed Graph.parents to return [Revision; 2]

2018-12-12 Thread kevincox (Kevin Cox)
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]); > +

D5415: rust: changed Graph.parents to return [Revision; 2]

2018-12-12 Thread gracinet (Georges Racinet)
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