Page MenuHomePhabricator

rhg: Move `Repo` object creation into `main()`
ClosedPublic

Authored by SimonSapin on Feb 17 2021, 7:57 AM.

Details

Summary

… rather than in each sub-command that needs a local repository.

This will allow accessing e.g. .hg/blackbox.log before dispatching
to sub-commands.

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

SimonSapin created this revision.Feb 17 2021, 7:57 AM
Alphare accepted this revision.Feb 18 2021, 3:57 AM
Alphare added a subscriber: Alphare.
Alphare added inline comments.
rust/rhg/src/commands/cat.rs
41

I really like this, because it makes it an error very easily for all commands that do require a repo with no boilerplate.

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