annotate rust/rhg/src/commands.rs @ 45548:33ded2d3f4fc

rhg: add a limited `rhg cat -r` subcommand It only supports revision specification (rev or full hash) and the list of files to cat. Differential Revision: https://phab.mercurial-scm.org/D9052
author Antoine Cezar <antoine.cezar@octobus.net>
date Tue, 15 Sep 2020 16:51:11 +0200
parents 66756b34c06e
children ead435aa5294
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
45548
33ded2d3f4fc rhg: add a limited `rhg cat -r` subcommand
Antoine Cezar <antoine.cezar@octobus.net>
parents: 45534
diff changeset
1 pub mod cat;
45534
66756b34c06e rhg: add a `DebugData` `Command` to prepare the `rhg debugdata` subcommand
Antoine Cezar <antoine.cezar@octobus.net>
parents: 45449
diff changeset
2 pub mod debugdata;
45384
5fe25f8ef5d9 rhg: add a `Files` `Command` to prepare the `rhg files` subcommand
Antoine Cezar <antoine.cezar@octobus.net>
parents: 45381
diff changeset
3 pub mod files;
45050
513b3ef277a3 rhg: add RootCommand using hg-core FindRoot operation to prepare `hg root`
Antoine Cezar <antoine.cezar@octobus.net>
parents: 45002
diff changeset
4 pub mod root;
45002
bacf6c7ef01b rhg: add Command trait for subcommands implemented by rhg
Antoine Cezar <antoine.cezar@octobus.net>
parents:
diff changeset
5 use crate::error::CommandError;
45449
ed95ccc94333 rhg: pass `ui` to `Command` `run`
Antoine Cezar <antoine.cezar@octobus.net>
parents: 45384
diff changeset
6 use crate::ui::Ui;
45002
bacf6c7ef01b rhg: add Command trait for subcommands implemented by rhg
Antoine Cezar <antoine.cezar@octobus.net>
parents:
diff changeset
7
bacf6c7ef01b rhg: add Command trait for subcommands implemented by rhg
Antoine Cezar <antoine.cezar@octobus.net>
parents:
diff changeset
8 /// The common trait for rhg commands
bacf6c7ef01b rhg: add Command trait for subcommands implemented by rhg
Antoine Cezar <antoine.cezar@octobus.net>
parents:
diff changeset
9 ///
bacf6c7ef01b rhg: add Command trait for subcommands implemented by rhg
Antoine Cezar <antoine.cezar@octobus.net>
parents:
diff changeset
10 /// Normalize the interface of the commands provided by rhg
45449
ed95ccc94333 rhg: pass `ui` to `Command` `run`
Antoine Cezar <antoine.cezar@octobus.net>
parents: 45384
diff changeset
11 pub trait Command {
ed95ccc94333 rhg: pass `ui` to `Command` `run`
Antoine Cezar <antoine.cezar@octobus.net>
parents: 45384
diff changeset
12 fn run(&self, ui: &Ui) -> Result<(), CommandError>;
45002
bacf6c7ef01b rhg: add Command trait for subcommands implemented by rhg
Antoine Cezar <antoine.cezar@octobus.net>
parents:
diff changeset
13 }