Page MenuHomePhabricator

rust-dirstate: create dirstate submodule in hg-cpython

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



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

Diff Detail

rHG Mercurial
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

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.
let skip_state =|skip| skip.extract::<PyBytes>(py)?.data(py)[0] as i8);
let dirs_map = if ...
119 ↗(On Diff #15839)

Should there be a check that this element exists?

178 ↗(On Diff #15839)

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.