Turns out the necessary pieces were there already.
Like the Python implementation, we default to the first parent of the dirstate.
Details
- Reviewers
SimonSapin - Group Reviewers
hg-reviewers - Commits
- rHGd919b0ca8449: rhg: add support for calling `rhg cat` without a revision
Diff Detail
- Repository
- rHG Mercurial
- Branch
- default
- Lint
No Linters Available - Unit
No Unit Test Coverage
Event Timeline
Note to reviewers: this needs the other patches in the stack to pass all tests, but in order to make the tests in the patches actually meaningful, this had to go first.
https://foss.heptapod.net/octobus/mercurial-devel/-/jobs/243241 Successful CI run (since baymax does not need to refresh this stack)
rust/rhg/src/commands/cat.rs | ||
---|---|---|
63 | What should happen when p1 is null? (Such as in a new empty repository.) Is this case covered by tests? | |
63 | Making a hex string just to parse it again feels a bit silly, but is likely required by the current signature of hg::operations::cat. That can be refactored later. |
rust/rhg/src/commands/cat.rs | ||
---|---|---|
63 |
If p1 is nullrev, it's the same path as any other revision, but if the dirstate does not exist, then it's an abort in the same way as hg does it. Should I add a testcase in test-cat.t or somewhere similar? |
rust/rhg/src/commands/cat.rs | ||
---|---|---|
63 | I guess I should have just tried it: $ cd /tmp $ hg init repo $ cd repo $ hg cat a a: no such file in rev 000000000000 Indeed that look like the same code path. Still, yes adding that test sounds good. |
What should happen when p1 is null? (Such as in a new empty repository.) Is this case covered by tests?