( )⚙ D6626 rust-dirstate: create dirstate submodule in hg-cpython

This is an archive of the discontinued Mercurial Phabricator instance.

rust-dirstate: create dirstate submodule in hg-cpython
ClosedPublic

Authored by Alphare on Jul 10 2019, 7:46 AM.

Details

Summary

This module will soon hold multiple files, this change is to make the
review process easier.

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

Alphare created this revision.Jul 10 2019, 7:46 AM
kevincox accepted this revision.Jul 12 2019, 11:52 AM
kevincox added inline comments.
rust/hg-cpython/src/dirstate/dirs_multiset.rs
34
let skip_state = skip.map(|skip| skip.extract::<PyBytes>(py)?.data(py)[0] as i8);
35
let dirs_map = if ...
68
.map(py.None())
rust/hg-cpython/src/dirstate/mod.rs
119

Should there be a check that this element exists?

178

I think I would find it more readable as for (filename, dirstate) in .... If you want to unpack it I would do that in the first line of the loop body. However it might also be best just to use dirstate.state. I guess the downside there is you don't get a compile error if a new field is added.

Alphare marked an inline comment as done.Jul 24 2019, 11:15 AM

Most of those will be taken care of in a follow-up patch, since they're cosmetic, plus this change just moves code around.

Alphare updated this revision to Diff 16044.Jul 24 2019, 11:22 AM
This revision was not accepted when it landed; it landed in state Needs Review.
This revision was automatically updated to reflect the committed changes.