This is an archive of the discontinued Mercurial Phabricator instance.

rust-dirs-multiset: improve temporary error message
ClosedPublic

Authored by Alphare on Jan 17 2020, 5:41 AM.

Details

Summary

While we wait on a future patch that could verify that the paths passed to
DirsMultiset have been audited, we still need to handle this error.
This patch makes it easier to bubble up and makes the error clearer.

Also, this patch introduces the subslice_index function that could be useful
for other - albeit niche - purposes.

Diff Detail

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

Event Timeline

Alphare created this revision.Jan 17 2020, 5:41 AM
kevincox requested changes to this revision.Jan 24 2020, 4:59 AM
kevincox added inline comments.
rust/hg-core/src/dirstate/dirs_multiset.rs
84

It appears to me that find_dirs always returns prefixes. Why is this offset required?

This revision now requires changes to proceed.Jan 24 2020, 4:59 AM
Alphare marked an inline comment as done.Jan 24 2020, 5:16 AM

It seems this one doesn't apply cleanly

pulkit accepted this revision.Feb 7 2020, 4:10 PM
This revision was not accepted when it landed; it landed in state Needs Review.
This revision was automatically updated to reflect the committed changes.