This is an archive of the discontinued Mercurial Phabricator instance.

hg-core: add FindRoot operation to find repository root path
ClosedPublic

Authored by acezar on Jun 5 2020, 10:31 AM.

Diff Detail

Repository
rHG Mercurial
Branch
default
Lint
No Linters Available
Unit
No Unit Test Coverage

Event Timeline

acezar created this revision.Jun 5 2020, 10:31 AM

Pathc looks overall good to me. I have a question regarding the test about some potential tempfile leackage that I woudl like clarified.

rust/hg-core/src/operations/find_root.rs
22

(small nits: s/current/current/)

70

small nits: s/anscestors/ancestors/

91

Do we have to do anything to make sure the temporary directory is deleted at the end of the run ? or are we leaking them ?

Alphare accepted this revision.Jun 15 2020, 5:31 AM
Alphare added a subscriber: Alphare.
Alphare added inline comments.
rust/hg-core/src/operations/find_root.rs
11

nit: s/exists/exist

91

https://docs.rs/tempfile/3.1.0/tempfile/struct.TempDir.html#resource-leaking

This is what tempfile does, whether that's acceptable is arguable.

acezar updated this revision to Diff 21644.Jun 16 2020, 12:20 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.
acezar updated this revision to Diff 21654.Jun 17 2020, 4:25 AM