changeset 44981:cf04f62d1579

rhg: add rhg crate The goal of rhg is to speedup some of hg's commands when possible by bypassing python entirely for the time being. It is by no means a replacement for hg as it will not support extentions or configuration and implement only a subset of hg's commands and options. Only use rhg if you understand what the tradeoffs are. Differential Revision: https://phab.mercurial-scm.org/D8610
author Antoine Cezar <antoine.cezar@octobus.net>
date Fri, 05 Jun 2020 10:28:58 +0200
parents 5965efb609b6
children bacf6c7ef01b
files rust/Cargo.lock rust/Cargo.toml rust/rhg/Cargo.toml rust/rhg/README.md rust/rhg/rustfmt.toml rust/rhg/src/exitcode.rs rust/rhg/src/main.rs
diffstat 7 files changed, 29 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/rust/Cargo.lock	Fri Jun 05 08:48:09 2020 +0200
+++ b/rust/Cargo.lock	Fri Jun 05 10:28:58 2020 +0200
@@ -487,6 +487,10 @@
 ]
 
 [[package]]
+name = "rhg"
+version = "0.1.0"
+
+[[package]]
 name = "rustc_version"
 version = "0.2.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
--- a/rust/Cargo.toml	Fri Jun 05 08:48:09 2020 +0200
+++ b/rust/Cargo.toml	Fri Jun 05 10:28:58 2020 +0200
@@ -1,3 +1,3 @@
 [workspace]
-members = ["hg-core", "hg-cpython"]
+members = ["hg-core", "hg-cpython", "rhg"]
 exclude = ["chg", "hgcli"]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rust/rhg/Cargo.toml	Fri Jun 05 10:28:58 2020 +0200
@@ -0,0 +1,8 @@
+[package]
+name = "rhg"
+version = "0.1.0"
+authors = ["Antoine Cezar <antoine.cezar@octobus.net>"]
+edition = "2018"
+
+[dependencies]
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rust/rhg/README.md	Fri Jun 05 10:28:58 2020 +0200
@@ -0,0 +1,4 @@
+# rhg
+
+This project provides a fastpath Rust implementation of the Mercurial (`hg`)
+version control tool.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rust/rhg/rustfmt.toml	Fri Jun 05 10:28:58 2020 +0200
@@ -0,0 +1,3 @@
+max_width = 79
+wrap_comments = true
+error_on_line_overflow = true
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rust/rhg/src/exitcode.rs	Fri Jun 05 10:28:58 2020 +0200
@@ -0,0 +1,4 @@
+pub type ExitCode = i32;
+
+/// Command not implemented by rhg
+pub const UNIMPLEMENTED_COMMAND: ExitCode = 252;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rust/rhg/src/main.rs	Fri Jun 05 10:28:58 2020 +0200
@@ -0,0 +1,5 @@
+mod exitcode;
+
+fn main() {
+    std::process::exit(exitcode::UNIMPLEMENTED_COMMAND)
+}