This matches the behavior of hg files.
The util is added in hg-core instead of rhg because this operation could
be useful for other external tools. (this was definitely not prompted by rust
issue #50784, I swear)
Details
- Reviewers
Alphare marmoute pulkit - Group Reviewers
hg-reviewers - Commits
- rHG1b3197047f5c: rhg: make output of `files` relative to the current directory and the root
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
To reviewers: this was my changeset, I'm not sure how authorship is attributed but I... accept the revision of course.
rust/hg-core/src/utils/files.rs | ||
---|---|---|
274 | It feels weird to me that this returns [u8] instead of an HgPath[Buf]. What's your justification for this? |
rust/hg-core/src/utils/files.rs | ||
---|---|---|
274 | An HgPath[Buf] is meant to be the canonical internal representation of a Mercurial path. There are a few places already where this "rule" is violated, but I am planning on refactoring them, and I can start by not adding a new instance of that issue. |
This looks fine.
rust/hg-core/src/operations/list_tracked_files.rs | ||
---|---|---|
71 | Doesn't all operation that need a repository needs to find the repository root just to be able to open it anyway ? or am I missing something? |
rust/hg-core/src/utils/files.rs | ||
---|---|---|
274 | By canonical, you mean "relative to the repository root" right ? And that is why a "relative to current working copy" path cannot fit in that. That seems right. Using Vec<u8> seems fine since this is a intended for display only. |
Doesn't all operation that need a repository needs to find the repository root just to be able to open it anyway ? or am I missing something?