D7788: rust-node: binary Node ID and conversion utilities

2020-01-22 Thread gracinet (Georges Racinet)
revlog.rs rust/hg-core/src/revlog/node.rs CHANGE DETAILS diff --git a/rust/hg-core/src/revlog/node.rs b/rust/hg-core/src/revlog/node.rs new file mode 100644 --- /dev/null +++ b/rust/hg-core/src/revlog/node.rs @@ -0,0 +1,191 @@ +// Copyright 2019-2020 Georges Racinet +// +// This software may

D7788: rust-node: binary Node ID and conversion utilities

2020-01-22 Thread gracinet (Georges Racinet)
gracinet added a comment. gracinet marked 6 inline comments as done. As the new commit description explains, I've done all I could to make the change of hash format easier I should add that my other colleagues at Octobus seem also to be involved in the improvement of hashing, there's no

D7787: rust-nodemap: building blocks for nodetree structures

2020-01-22 Thread gracinet (Georges Racinet)
map.rs CHANGE DETAILS diff --git a/rust/hg-core/src/revlog/nodemap.rs b/rust/hg-core/src/revlog/nodemap.rs new file mode 100644 --- /dev/null +++ b/rust/hg-core/src/revlog/nodemap.rs @@ -0,0 +1,160 @@ +// Copyright 2018-2020 Georges Racinet +// and Mercurial contributors +// +// This s

D7788: rust-node: binary Node ID and conversion utilities

2020-01-22 Thread gracinet (Georges Racinet)
rust/hg-core/Cargo.toml rust/hg-core/src/revlog.rs rust/hg-core/src/revlog/node.rs CHANGE DETAILS diff --git a/rust/hg-core/src/revlog/node.rs b/rust/hg-core/src/revlog/node.rs new file mode 100644 --- /dev/null +++ b/rust/hg-core/src/revlog/node.rs @@ -0,0 +1,191 @@ +// Copyright 2019-2020 G

D7789: rust-revlog: a trait for the revlog index

2020-01-23 Thread gracinet (Georges Racinet)
gracinet added a comment. @martinvonz yeah, probably wrote the doc-comment too fast Of course it's meant to match what revlog.c does, since the first implementation willl actually be re-exposure of the C version REPOSITORY rHG Mercurial CHANGES SINCE LAST ACTION https://phab.mercuri

D7789: rust-revlog: a trait for the revlog index

2020-01-27 Thread gracinet (Georges Racinet)
gracinet updated this revision to Diff 19629. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7789?vs=19038&id=19629 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7789/new/ REVISION DETAIL https://phab.mercurial-scm.org/D7

D7790: rust-node: handling binary Node prefix

2020-01-27 Thread gracinet (Georges Racinet)
gracinet edited the summary of this revision. gracinet updated this revision to Diff 19630. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7790?vs=19039&id=19630 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7790/new/ REVIS

D7792: rust-nodemap: abstracting the indexing

2020-01-27 Thread gracinet (Georges Racinet)
gracinet updated this revision to Diff 19632. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7792?vs=19325&id=19632 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7792/new/ REVISION DETAIL https://phab.mercurial-scm.org/D7

D7791: rust-nodemap: NodeMap trait with simplest implementation

2020-01-27 Thread gracinet (Georges Racinet)
gracinet retitled this revision from "rust-nodemap: NodeMap trait with simplest implementor" to "rust-nodemap: NodeMap trait with simplest implementation". gracinet updated this revision to Diff 19631. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7791?vs

D7793: rust-nodemap: mutable NodeTree data structure

2020-01-27 Thread gracinet (Georges Racinet)
gracinet updated this revision to Diff 19633. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7793?vs=19326&id=19633 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7793/new/ REVISION DETAIL https://phab.mercurial-scm.org/D7

D7794: rust-nodemap: generic NodeTreeVisitor

2020-01-27 Thread gracinet (Georges Racinet)
gracinet edited the summary of this revision. gracinet updated this revision to Diff 19634. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7794?vs=19327&id=19634 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7794/new/ REVIS

D7795: rust-nodemap: insert method

2020-01-27 Thread gracinet (Georges Racinet)
gracinet updated this revision to Diff 19635. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7795?vs=19328&id=19635 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7795/new/ REVISION DETAIL https://phab.mercurial-scm.org/D7

D7796: rust-nodemap: input/output primitives

2020-01-27 Thread gracinet (Georges Racinet)
gracinet edited the summary of this revision. gracinet updated this revision to Diff 19636. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7796?vs=19329&id=19636 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7796/new/ REVIS

D7798: rust-nodemap: special case for prefixes of NULL_NODE

2020-01-27 Thread gracinet (Georges Racinet)
gracinet updated this revision to Diff 19638. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7798?vs=19330&id=19638 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7798/new/ REVISION DETAIL https://phab.mercurial-scm.org/D7

D7797: rust-nodemap: pure Rust example

2020-01-27 Thread gracinet (Georges Racinet)
n.rs new file mode 100644 --- /dev/null +++ b/rust/hg-core/examples/nodemap/main.rs @@ -0,0 +1,150 @@ +// Copyright 2019-2020 Georges Racinet +// +// This software may be used and distributed according to the terms of the +// GNU General Public License version 2 or any later version. + +extern c

D7819: rust-nodemap: core implementation for shortest

2020-01-27 Thread gracinet (Georges Racinet)
gracinet updated this revision to Diff 19639. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7819?vs=19331&id=19639 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7819/new/ REVISION DETAIL https://phab.mercurial-scm.org/D7

D7790: rust-node: handling binary Node prefix

2020-01-27 Thread gracinet (Georges Racinet)
gracinet added a comment. > Depends on the definition of NodePrefixRef. I don't think there would be any extra allocation if you define it like this: pub enum NodePrefixRef<'a> { Full(&'a Node), Prefix(&'a NodePrefix), } That's an interesting idea, another

D7791: rust-nodemap: NodeMap trait with simplest implementation

2020-01-27 Thread gracinet (Georges Racinet)
gracinet added inline comments. gracinet marked 3 inline comments as done. INLINE COMMENTS > kevincox wrote in nodemap.rs:37 > Can you please add doc-comments for this? I find that documenting trait > methods is especially important. Sure, indeed it's more important than with the `impl`. > mar

D7792: rust-nodemap: abstracting the indexing

2020-01-27 Thread gracinet (Georges Racinet)
gracinet added inline comments. gracinet marked 2 inline comments as done. INLINE COMMENTS > kevincox wrote in nodemap.rs:193 > I would add a `self.is_empty()` helper. It's good practice for anything that > has a `.len()`. Sure REPOSITORY rHG Mercurial CHANGES SINCE LAST ACTION https://ph

D7793: rust-nodemap: mutable NodeTree data structure

2020-01-27 Thread gracinet (Georges Racinet)
gracinet added inline comments. INLINE COMMENTS > kevincox wrote in nodemap.rs:158 > This strikes me as a weird name. The fact that it is an adjective rather than > a noun is a hint. Can you rename to answer "Growable what?" In a previous version, I was calling it `mutable` (also an adjective,

D7794: rust-nodemap: generic NodeTreeVisitor

2020-01-27 Thread gracinet (Georges Racinet)
gracinet added inline comments. gracinet marked 2 inline comments as done. INLINE COMMENTS > martinvonz wrote in nodemap.rs:264-269 > There will only be a valid result if this is a leaf, so it might be better to > combine `leaf` and `opt` into one `Option>` so the caller > cannot mistake a `opt

D7796: rust-nodemap: input/output primitives

2020-01-27 Thread gracinet (Georges Racinet)
gracinet added inline comments. gracinet marked 2 inline comments as done. INLINE COMMENTS > kevincox wrote in nodemap.rs:268 > I thought about this more and I think I am okay doing it this way. It seems > like this should be well defined as long as there is no padding. However on > that note I

D7819: rust-nodemap: core implementation for shortest

2020-01-27 Thread gracinet (Georges Racinet)
gracinet added inline comments. gracinet marked 3 inline comments as done. INLINE COMMENTS > kevincox wrote in nodemap.rs:337 > Can you describe the return value in the doc comment. Done > martinvonz wrote in nodemap.rs:575 > I'm fine with either. We'll expose it as "shortest" in the python API

D7819: rust-nodemap: core implementation for shortest

2020-01-27 Thread gracinet (Georges Racinet)
gracinet marked an inline comment as done. gracinet updated this revision to Diff 19640. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7819?vs=19639&id=19640 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7819/new/ REVISION

D7789: rust-revlog: a trait for the revlog index

2020-01-27 Thread gracinet (Georges Racinet)
Closed by commit rHG3fb39dc2e356: rust-revlog: a trait for the revlog index (authored by gracinet). This revision was automatically updated to reflect the committed changes. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7789?vs=19629&id=19642 CHANGES SIN

D7790: rust-node: handling binary Node prefix

2020-01-27 Thread gracinet (Georges Racinet)
Closed by commit rHG9896a8d0d3d2: rust-node: handling binary Node prefix (authored by gracinet). This revision was automatically updated to reflect the committed changes. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7790?vs=19630&id=19643 CHANGES SINCE

D7790: rust-node: handling binary Node prefix

2020-01-27 Thread gracinet (Georges Racinet)
gracinet added inline comments. INLINE COMMENTS > martinvonz wrote in node.rs:226 > Should we check here that `i < self.len()`? I'm especially thinking of the > case of an odd-length prefix where we would otherwise silently return 0. yes, indeed. current callers from `nodemap` work either on f

D7794: rust-nodemap: generic NodeTreeVisitor

2020-01-27 Thread gracinet (Georges Racinet)
gracinet added inline comments. gracinet marked 2 inline comments as done. INLINE COMMENTS > martinvonz wrote in nodemap.rs:300 > would something like `block_index` be clearer? I found it to be clearer for the emitter, but in the iterator implementation, it expresses what's to be done next, sam

D7792: rust-nodemap: abstracting the indexing

2020-01-27 Thread gracinet (Georges Racinet)
Closed by commit rHG220d4d2e3185: rust-nodemap: abstracting the indexing (authored by gracinet). gracinet marked an inline comment as done. This revision was automatically updated to reflect the committed changes. This revision was not accepted when it landed; it landed in state "Needs Review".

D7793: rust-nodemap: mutable NodeTree data structure

2020-01-27 Thread gracinet (Georges Racinet)
Closed by commit rHGa19331456d48: rust-nodemap: mutable NodeTree data structure (authored by gracinet). This revision was automatically updated to reflect the committed changes. This revision was not accepted when it landed; it landed in state "Needs Review". REPOSITORY rHG Mercurial CHANGES

D7791: rust-nodemap: NodeMap trait with simplest implementation

2020-01-27 Thread gracinet (Georges Racinet)
Closed by commit rHGe52401a95b94: rust-nodemap: NodeMap trait with simplest implementation (authored by gracinet). gracinet marked 2 inline comments as done. This revision was automatically updated to reflect the committed changes. This revision was not accepted when it landed; it landed in state

D7794: rust-nodemap: generic NodeTreeVisitor

2020-01-27 Thread gracinet (Georges Racinet)
Closed by commit rHG796d05f3fa84: rust-nodemap: generic NodeTreeVisitor (authored by gracinet). gracinet marked an inline comment as done. This revision was automatically updated to reflect the committed changes. This revision was not accepted when it landed; it landed in state "Needs Review". R

D8019: rust-node: avoid meaningless read at the end of odd prefix

2020-01-27 Thread gracinet (Georges Racinet)
gracinet created this revision. Herald added subscribers: mercurial-devel, kevincox. Herald added a reviewer: hg-reviewers. REVISION SUMMARY This should be heavily factored out by the CPU branch predictor anyway. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mer

D8019: rust-node: avoid meaningless read at the end of odd prefix

2020-01-28 Thread gracinet (Georges Racinet)
Closed by commit rHGbe52b7372ec2: rust-node: avoid meaningless read at the end of odd prefix (authored by gracinet). This revision was automatically updated to reflect the committed changes. This revision was not accepted when it landed; it landed in state "Needs Review". REPOSITORY rHG Mercur

D7795: rust-nodemap: insert method

2020-02-12 Thread gracinet (Georges Racinet)
Closed by commit rHGd2da8667125b: rust-nodemap: insert method (authored by gracinet). This revision was automatically updated to reflect the committed changes. This revision was not accepted when it landed; it landed in state "Needs Review". CHANGED PRIOR TO COMMIT https://phab.mercurial-scm.o

D7796: rust-nodemap: input/output primitives

2020-02-26 Thread gracinet (Georges Racinet)
Closed by commit rHGc3cc881aaa17: rust-nodemap: input/output primitives (authored by gracinet). gracinet marked an inline comment as done. This revision was automatically updated to reflect the committed changes. This revision was not accepted when it landed; it landed in state "Needs Review". R

D7798: rust-nodemap: special case for prefixes of NULL_NODE

2020-02-26 Thread gracinet (Georges Racinet)
Closed by commit rHG895934342631: rust-nodemap: special case for prefixes of NULL_NODE (authored by gracinet). This revision was automatically updated to reflect the committed changes. This revision was not accepted when it landed; it landed in state "Needs Review". REPOSITORY rHG Mercurial C

D7797: rust-nodemap: pure Rust example

2020-02-26 Thread gracinet (Georges Racinet)
x.rs rust/hg-core/examples/nodemap/main.rs CHANGE DETAILS diff --git a/rust/hg-core/examples/nodemap/main.rs b/rust/hg-core/examples/nodemap/main.rs new file mode 100644 --- /dev/null +++ b/rust/hg-core/examples/nodemap/main.rs @@ -0,0 +1,146 @@ +// Copyright 2019-2020 Georges Racinet +// +//

D8098: rust-nodemap: a method for full invalidation

2020-02-26 Thread gracinet (Georges Racinet)
Closed by commit rHGbbc61f36733c: rust-nodemap: a method for full invalidation (authored by gracinet). This revision was automatically updated to reflect the committed changes. This revision was not accepted when it landed; it landed in state "Needs Review". REPOSITORY rHG Mercurial CHANGES S

D8097: rust-nodemap: accounting for dead blocks

2020-02-26 Thread gracinet (Georges Racinet)
Closed by commit rHG706c1bd7f71c: rust-nodemap: accounting for dead blocks (authored by gracinet). This revision was automatically updated to reflect the committed changes. This revision was not accepted when it landed; it landed in state "Needs Review". REPOSITORY rHG Mercurial CHANGES SINCE

D7819: rust-nodemap: core implementation for shortest

2020-02-26 Thread gracinet (Georges Racinet)
Closed by commit rHG0e8a9c0fbc8c: rust-nodemap: core implementation for shortest (authored by gracinet). This revision was automatically updated to reflect the committed changes. This revision was not accepted when it landed; it landed in state "Needs Review". REPOSITORY rHG Mercurial CHANGES

D5358: rust: peek_mut optim for lazy ancestors

2018-12-03 Thread gracinet (Georges Racinet)
gracinet created this revision. Herald added subscribers: mercurial-devel, kevincox, durin42. Herald added a reviewer: hg-reviewers. REVISION SUMMARY This is one of the two optimizations that are also present in the Python code: replacing pairs of pop/push on the BinaryHeap by single updates

D5358: rust: peek_mut optim for lazy ancestors

2018-12-04 Thread gracinet (Georges Racinet)
This revision was automatically updated to reflect the committed changes. Closed by commit rHG04ebdb33e5d0: rust: peek_mut optim for lazy ancestors (authored by gracinet, committed by ). CHANGED PRIOR TO COMMIT https://phab.mercurial-scm.org/D5358?vs=12683&id=12694#toc REPOSITORY rHG Mercuri

D5365: rust: AncestorsIterator::next, renamed local variables

2018-12-04 Thread gracinet (Georges Racinet)
gracinet created this revision. Herald added subscribers: mercurial-devel, kevincox, durin42. Herald added a reviewer: hg-reviewers. REVISION SUMMARY It was confusing to have p1 and parents.1 ; (p1, p2) is clearer. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mer

D5369: rust: make clean takes care of rust/target

2018-12-04 Thread gracinet (Georges Racinet)
gracinet created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY This isn't the prettiest way of doing it, but it doesn't require looking up cargo, or wondering whether that should be part of setup.py clean. REPOSITORY rHG M

D5370: rust: core implementation of missingancestors (no bindings)

2018-12-04 Thread gracinet (Georges Racinet)
gracinet created this revision. Herald added subscribers: mercurial-devel, mjpieters, kevincox, durin42. Herald added a reviewer: hg-reviewers. REVISION SUMMARY rust: iterator version of Graph.parents This is handy for callers that want to simply do: for p in graph.parents_iter(rev)

D5369: rust: make clean takes care of rust/target

2018-12-05 Thread gracinet (Georges Racinet)
This revision was automatically updated to reflect the committed changes. Closed by commit rHG9072a890e523: rust: make clean takes care of rust/target (authored by gracinet, committed by ). CHANGED PRIOR TO COMMIT https://phab.mercurial-scm.org/D5369?vs=12700&id=12710#toc REPOSITORY rHG Merc

D5365: rust: AncestorsIterator::next, renamed local variables

2018-12-05 Thread gracinet (Georges Racinet)
This revision was automatically updated to reflect the committed changes. Closed by commit rHG70976974c14a: rust: rename local variables in AncestorsIterator::next (authored by gracinet, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5365?v

D5370: rust: core implementation of missingancestors (no bindings)

2018-12-05 Thread gracinet (Georges Racinet)
gracinet added a comment. I'll include your remark in the upcoming v2, thanks again ! INLINE COMMENTS > kevincox wrote in ancestors.rs:159 > Is always having an item in the set actually saving many corner cases? It > seems like you usually check for empty sets anyways. Not sure about this,

D5370: rust: core implementation of missingancestors (no bindings)

2018-12-06 Thread gracinet (Georges Racinet)
gracinet added a comment. @yuja: do you mean one of those Differential Revisions of this system for each commit, sure I can do. With respect to rust-cpython bindings, I'm currently waiting for feedback on https://github.com/dgrunwald/rust-cpython/issues/164 Perhaps you'd have an idea ?

D5370: rust: core implementation of missingancestors (no bindings)

2018-12-12 Thread gracinet (Georges Racinet)
gracinet marked 11 inline comments as done. gracinet added a comment. @yuja trying to submit the v2 with phabsend instead of arcanist… hope it'll be linked properly INLINE COMMENTS > kevincox wrote in ancestors.rs:201 > Isn't this loop redundant with the retain call above? indeed, must have

D5414: rust: improved docstring

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 In the previous wording, rustfmt wanted to cut at the == which is not very readable in my taste. REPOSITORY rHG Mercurial REVISION DETAIL

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 b

D5416: rust: translation of missingancestors

2018-12-12 Thread gracinet (Georges Racinet)
gracinet created this revision. Herald added subscribers: mercurial-devel, mjpieters, kevincox, durin42. Herald added a reviewer: hg-reviewers. REVISION SUMMARY This is as direct as possible a translation of the ancestor.missingancestors Python class in pure Rust. The goal for this changeset i

D5417: rust: translated random test of missingancestors

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 In case of a failed example, all needed information for reproduction is included in the panic message, so that we don't need to seed the ran

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&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

D5416: rust: translation of missingancestors

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

D5417: rust: translated random test of missingancestors

2018-12-12 Thread gracinet (Georges Racinet)
gracinet updated this revision to Diff 12833. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5417?vs=12830&id=12833 REVISION DETAIL https://phab.mercurial-scm.org/D5417 AFFECTED FILES rust/Cargo.lock rust/hg-core/Cargo.toml rust/hg-core/src/ancest

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.

D5414: rust: improved docstring

2018-12-13 Thread gracinet (Georges Racinet)
This revision was automatically updated to reflect the committed changes. Closed by commit rHGceb695c3c154: rust: improved docstring (authored by gracinet, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5414?vs=12827&id=12834 REVISION DETA

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

D5418: perfdiscovery: benching findcommonheads()

2018-12-13 Thread gracinet (Georges Racinet)
gracinet created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY This works between the local repo and any peer given by its path, and should be useful for further work on discovery REPOSITORY rHG Mercurial REVISION DETAIL

D5418: perfdiscovery: benching findcommonheads()

2018-12-13 Thread gracinet (Georges Racinet)
gracinet added a comment. @pulkit indeed, I didn't think of that, seems like a good idea, thanks. I wouldn't go as far as putting `path=default` by default, though, so that users don't start hammering providers unwillingly. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercuria

D5418: perfdiscovery: benching findcommonheads()

2018-12-14 Thread gracinet (Georges Racinet)
gracinet updated this revision to Diff 12837. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5418?vs=12836&id=12837 REVISION DETAIL https://phab.mercurial-scm.org/D5418 AFFECTED FILES contrib/perf.py tests/test-contrib-perf.t CHANGE DETAILS diff -

D5418: perfdiscovery: benching findcommonheads()

2018-12-14 Thread gracinet (Georges Racinet)
This revision was automatically updated to reflect the committed changes. Closed by commit rHG716ce792886c: perfdiscovery: benching findcommonheads() (authored by gracinet, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5418?vs=12837&id=128

D5416: rust: translation of missingancestors

2018-12-14 Thread gracinet (Georges Racinet)
gracinet updated this revision to Diff 12855. gracinet marked an inline comment as done. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5416?vs=12832&id=12855 REVISION DETAIL https://phab.mercurial-scm.org/D5416 AFFECTED FILES rust/hg-core/src/ancesto

D5417: rust: translated random test of missingancestors

2018-12-14 Thread gracinet (Georges Racinet)
gracinet updated this revision to Diff 12856. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5417?vs=12833&id=12856 REVISION DETAIL https://phab.mercurial-scm.org/D5417 AFFECTED FILES rust/Cargo.lock rust/hg-core/Cargo.toml rust/hg-core/src/ancest

D5416: rust: translation of missingancestors

2018-12-14 Thread gracinet (Georges Racinet)
gracinet marked 2 inline comments as done. gracinet added a comment. Thanks for the useful tips! INLINE COMMENTS > kevincox wrote in ancestors.rs:154 > Why not just write: > > self.bases.iter().any(|b| != NULL_REVISION) > > It is much clearer what you mean and I suspect the performance is

D5416: rust: translation of missingancestors

2018-12-14 Thread gracinet (Georges Racinet)
This revision was automatically updated to reflect the committed changes. gracinet marked an inline comment as done. Closed by commit rHG5817c3b186a7: rust: translation of missingancestors (authored by gracinet, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.

D5417: rust: translated random test of missingancestors

2018-12-15 Thread gracinet (Georges Racinet)
gracinet added a comment. @yuja: I'll look into it, maybe that's a case for benches (I've not played with them yet). REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5417 To: gracinet, #hg-reviewers Cc: yuja, durin42, kevincox, mercurial-devel ___

D5433: rust-cpython: excluded hgcli from workspace

2018-12-15 Thread gracinet (Georges Racinet)
gracinet created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY hgcli uses a specific rust-cpython commit by indygreg, of which a PR has been derived which is not merged nor released yet. But we can't use several versions

D5435: rust: better treatment of cargo/rustc errors

2018-12-15 Thread gracinet (Georges Racinet)
gracinet created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5435 AFFECTED FILES setup.py CHANGE DETAILS diff --git a/setup.py b/setup.py --- a/setup.py +++ b/se

D5436: rust-cpython: build via HGWITHRUSTEXT=cpython

2018-12-15 Thread gracinet (Georges Racinet)
gracinet created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY The existing behaviour, building the direct ffi bindings if HGIWTHRUSTEXT is just set is unchanged, but if HGWITHRUSTEXT is cpython, then the cpython bindings (

D5439: rust-cpython: binding for AncestorsIterator

2018-12-15 Thread gracinet (Georges Racinet)
gracinet created this revision. Herald added subscribers: mercurial-devel, kevincox, durin42. Herald added a reviewer: hg-reviewers. REVISION SUMMARY It's now reachable from Python as rustext.ancestor.AncestorsIterator Tests are provided in the previously introduced Python testcase: thi

D5437: rust-cpython: testing the bindings from Python

2018-12-15 Thread gracinet (Georges Racinet)
gracinet created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY This is easier and more convincing than doing the same tests from a Rust tests module. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.o

D5434: rust-cpython: started cpython crate bindings

2018-12-15 Thread gracinet (Georges Racinet)
+1,40 @@ +// lib.rs +// +// Copyright 2018 Georges Racinet +// +// This software may be used and distributed according to the terms of the +// GNU General Public License version 2 or any later version. + +//! Python bindings of `hg-core` objects using the `cpython` crate. +//! Once compiled, the resulting s

D5438: rust-cpython: implementing Graph using C parents function

2018-12-15 Thread gracinet (Georges Racinet)
tern crate cpython; extern crate hg; +extern crate libc; mod ancestors; mod exceptions; diff --git a/rust/hg-cpython/src/cindex.rs b/rust/hg-cpython/src/cindex.rs new file mode 100644 --- /dev/null +++ b/rust/hg-cpython/src/cindex.rs @@ -0,0 +1,95 @@ +// cindex.rs +// +// Copyright 2018 Georges Rac

D5441: rust-cpython: binding for LazyAncestors

2018-12-15 Thread gracinet (Georges Racinet)
gracinet created this revision. Herald added subscribers: mercurial-devel, kevincox, durin42. Herald added a reviewer: hg-reviewers. REVISION SUMMARY For consistency with Python implementation, we're exposing it with the lower case spelling, so that if one day the whole ancestor module has a R

D5440: rust: core implementation for lazyancestors

2018-12-15 Thread gracinet (Georges Racinet)
gracinet created this revision. Herald added subscribers: mercurial-devel, kevincox, durin42. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Once exposed through appropriate bindings, this should be able to replace ancestor.lazyancestors entirely. REPOSITORY rHG Mercurial REVISI

D5442: rust-cpython: using the new bindings from Python

2018-12-15 Thread gracinet (Georges Racinet)
gracinet created this revision. Herald added a reviewer: indygreg. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY The Python callers detect if we have cpython or direct-ffi bindings and fallback to the Python implementation if none is pres

D5443: ancestor: uniformity of calling lazyancestors classes

2018-12-15 Thread gracinet (Georges Racinet)
gracinet created this revision. Herald added a reviewer: indygreg. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Up to now, the pure Python lazyancestors had been taking the parents function in its constructor, whereas Rust-backed variants

D5370: rust: core implementation of missingancestors (no bindings)

2018-12-15 Thread gracinet (Georges Racinet)
gracinet abandoned this revision. gracinet marked an inline comment as done. gracinet added a comment. This Differential has been superseded by https://phab.mercurial-scm.org/D5414 through https://phab.mercurial-scm.org/D5417 REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercuri

D5438: rust-cpython: implementing Graph using C parents function

2018-12-15 Thread gracinet (Georges Racinet)
gracinet added a comment. Here, I'd be tempted to submit a `py_capsule_fn` macro to rust-cpython, but I guess it can wait. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5438 To: gracinet, #hg-reviewers Cc: durin42, kevincox, mercurial-devel ___

D5443: ancestor: uniformity of calling lazyancestors classes

2018-12-15 Thread gracinet (Georges Racinet)
gracinet added a comment. obviously, this one could be adapted for application before the rust-cpython bindings, and extended for the `incrementalmissingancestors` as well REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5443 To: gracinet, indygreg, #hg-reviewers

D5435: rust: better treatment of cargo/rustc errors

2018-12-15 Thread gracinet (Georges Racinet)
This revision was automatically updated to reflect the committed changes. Closed by commit rHG5955cf85ed74: rust: better treatment of cargo/rustc errors (authored by gracinet, committed by ). CHANGED PRIOR TO COMMIT https://phab.mercurial-scm.org/D5435?vs=12872&id=12884#toc REPOSITORY rHG Me

D5437: rust-cpython: testing the bindings from Python

2018-12-15 Thread gracinet (Georges Racinet)
This revision was automatically updated to reflect the committed changes. Closed by commit rHG57e3dfeb3a5d: rust-cpython: testing the bindings from Python (authored by gracinet, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5437?vs=12874&i

D5436: rust-cpython: build via HGWITHRUSTEXT=cpython

2018-12-15 Thread gracinet (Georges Racinet)
This revision was automatically updated to reflect the committed changes. Closed by commit rHG9e755c16f05d: rust-cpython: build via HGWITHRUSTEXT=cpython (authored by gracinet, committed by ). CHANGED PRIOR TO COMMIT https://phab.mercurial-scm.org/D5436?vs=12873&id=12885#toc REPOSITORY rHG M

D5433: rust-cpython: excluded hgcli from workspace

2018-12-15 Thread gracinet (Georges Racinet)
This revision was automatically updated to reflect the committed changes. Closed by commit rHG6e815adf91de: rust-cpython: exclude hgcli from workspace (authored by gracinet, committed by ). CHANGED PRIOR TO COMMIT https://phab.mercurial-scm.org/D5433?vs=12870&id=12882#toc REPOSITORY rHG Merc

D5434: rust-cpython: started cpython crate bindings

2018-12-15 Thread gracinet (Georges Racinet)
s rust/hg-cpython/src/exceptions.rs rust/hg-cpython/src/lib.rs CHANGE DETAILS diff --git a/rust/hg-cpython/src/lib.rs b/rust/hg-cpython/src/lib.rs new file mode 100644 --- /dev/null +++ b/rust/hg-cpython/src/lib.rs @@ -0,0 +1,40 @@ +// lib.rs +// +// Copyright 2018 Georges Racinet +//

D5438: rust-cpython: implementing Graph using C parents function

2018-12-17 Thread gracinet (Georges Racinet)
gracinet added a comment. @yuja yes sorry, forgot to adapt to the new signature. That'll be fixed in next version, and in `revlog.c`, the capsule pointer declaration is now at the top. About protecting parents() with the GIL `Python<'p>`, I'll have to think more about it, but the soluti

D5438: rust-cpython: implementing Graph using C parents function

2018-12-17 Thread gracinet (Georges Racinet)
gracinet added a comment. I gave the solution to reacquire the GIL explicitely from Index a quick try, without even releasing it from the callers (which is ok according to https://docs.python.org/2.7/c-api/init.html#c.PyGILState_Ensure), and it is more than a 20% penalty. I'm measuring

D5439: rust-cpython: binding for AncestorsIterator

2018-12-17 Thread gracinet (Georges Racinet)
gracinet added a comment. @yuja thanks for spotting the Python3 incompatibility. As you can guess, I didn't compile with Python 3, and actually I hadn't even defined the features to that extent. I will submit separately a change that takes care of the build with Python 3 before updating th

D5446: rust-cpython: build and support for Python3

2018-12-17 Thread gracinet (Georges Racinet)
gracinet created this revision. Herald added subscribers: mercurial-devel, mjpieters. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Defined Cargo features for Python3, making them overall simpler to use, hooked them in build and made mercurial.rustext importable. This is tested

D5439: rust-cpython: binding for AncestorsIterator

2018-12-17 Thread gracinet (Georges Racinet)
gracinet added a comment. @yuja you're right! My first attempt was tainted with assigning to a `Vec`, whereas upon type inference with the actual return type `PyResult`, the compiler does the right thing so that was the escape plan for early returns in closures :-) amazing. REPOSITORY rH

D5446: rust-cpython: build and support for Python3

2018-12-18 Thread gracinet (Georges Racinet)
This revision was automatically updated to reflect the committed changes. Closed by commit rHG4277e20cfec4: rust-cpython: build and support for Python3 (authored by gracinet, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5446?vs=12889&id=1

D5446: rust-cpython: build and support for Python3

2018-12-18 Thread gracinet (Georges Racinet)
gracinet added a comment. @yuja great, thanks. Didn't know about this suffix, apparently it can be obtained through the `sysconfig` module (thats what `$PYTHON-config` does) ~ $ python2 -c "import sysconfig; print(sysconfig.get_config_var('SO'))" .so ~ $ python3 -c "impo

D5443: ancestor: uniformity of calling lazyancestors classes

2018-12-22 Thread gracinet (Georges Racinet)
gracinet added a comment. @yuja I'm not sure by what you consider exactly to be internals here. If that's the `[5]` and [6]`, maybe a `parents(revision)` method on the index would be better ? The obvious drawback would be to write more C code. Given that my ultimate goal here is to deleg

D5440: rust: core implementation for lazyancestors

2018-12-22 Thread gracinet (Georges Racinet)
gracinet added a comment. @yuja, yes a `Graph` not implementing `Clone` is already a good thing, as it avoids to implement `Clone` in `hg-direct-ffi` prematurely. I think the whole `hg::LazyAncestors` can end up being useful from core Rust code, too, that's why I prefer that to a `hg-cpython

D5439: rust-cpython: binding for AncestorsIterator

2018-12-22 Thread gracinet (Georges Racinet)
gracinet updated this revision to Diff 12950. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5439?vs=12876&id=12950 REVISION DETAIL https://phab.mercurial-scm.org/D5439 AFFECTED FILES rust/hg-cpython/src/ancestors.rs rust/hg-cpython/src/lib.rs tes

D5441: rust-cpython: binding for LazyAncestors

2018-12-22 Thread gracinet (Georges Racinet)
gracinet updated this revision to Diff 12952. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5441?vs=12878&id=12952 REVISION DETAIL https://phab.mercurial-scm.org/D5441 AFFECTED FILES rust/hg-cpython/src/ancestors.rs tests/test-rust-ancestor.py CHA

<    1   2   3   4   5   6   >