( )⚙ D11378 rhg-cat: fallback when detecting `.` or `..` path segments

This is an archive of the discontinued Mercurial Phabricator instance.

rhg-cat: fallback when detecting `.` or `..` path segments
ClosedPublic

Authored by Alphare on Sep 1 2021, 12:42 PM.

Details

Summary

We do not normalize paths correctly yet, so exclude the shortcuts.

Diff Detail

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

Event Timeline

Alphare created this revision.Sep 1 2021, 12:42 PM

Is https://doc.rust-lang.org/std/fs/fn.canonicalize.html the correct normalization needed here? (Note that it follows symlinks.) If it’s easy enough, it may be worth implementing the correct behavior instead of adding fallback.

Is https://doc.rust-lang.org/std/fs/fn.canonicalize.html the correct normalization needed here? (Note that it follows symlinks.) If it’s easy enough, it may be worth implementing the correct behavior instead of adding fallback.

This wouldn't work since the normalization must be independent from the fs. You can have hg cat -r 1 file_that_was_deleted_since_then, we need to use HgPath type normalization.

SimonSapin accepted this revision.Sep 9 2021, 9:36 AM

Ok. The correct normalization can be added later, let’s not block this patch.

This revision was not accepted when it landed; it landed in state Needs Review.
This revision was automatically updated to reflect the committed changes.