[Updated] D8608: hg-core: add Operation interface for high-level hg operations
acezar (Antoine Cezar)
phabricator at mercurial-scm.org
Tue Jun 16 21:43:12 UTC 2020
Closed by commit rHGa46e36b82461: hg-core: add Operation interface for high-level hg operations (authored by acezar).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D8608?vs=21552&id=21649
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D8608/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D8608
AFFECTED FILES
rust/hg-core/src/lib.rs
rust/hg-core/src/operations/mod.rs
CHANGE DETAILS
diff --git a/rust/hg-core/src/operations/mod.rs b/rust/hg-core/src/operations/mod.rs
new file mode 100644
--- /dev/null
+++ b/rust/hg-core/src/operations/mod.rs
@@ -0,0 +1,9 @@
+/// An interface for high-level hg operations.
+///
+/// A distinction is made between operation and commands.
+/// An operation is what can be done whereas a command is what is exposed by
+/// the cli. A single command can use several operations to achieve its goal.
+pub trait Operation<T> {
+ type Error;
+ fn run(&self) -> Result<T, Self::Error>;
+}
diff --git a/rust/hg-core/src/lib.rs b/rust/hg-core/src/lib.rs
--- a/rust/hg-core/src/lib.rs
+++ b/rust/hg-core/src/lib.rs
@@ -23,6 +23,7 @@
pub mod matchers;
pub mod revlog;
pub use revlog::*;
+pub mod operations;
pub mod utils;
// Remove this to see (potential) non-artificial compile failures. MacOS
To: acezar, #hg-reviewers, marmoute, Alphare
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20200616/fd266bd9/attachment-0002.html>
More information about the Mercurial-patches
mailing list