diff rust/hg-core/src/transaction.rs @ 52160:e01e84e5e426

rust-revlog: add a Rust-only `InnerRevlog` This mirrors the Python `InnerRevlog` and will be used in a future patch to replace said Python implementation. This allows us to start doing more things in pure Rust, in particular reading and writing operations. A lot of changes have to be introduced all at once, it wouldn't be very useful to separate this patch IMO since all of them are either interlocked or only useful with the rest.
author Rapha?l Gom?s <rgomes@octobus.net>
date Thu, 10 Oct 2024 10:34:51 +0200
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rust/hg-core/src/transaction.rs	Thu Oct 10 10:34:51 2024 +0200
@@ -0,0 +1,11 @@
+use std::path::Path;
+
+/// The Mercurial transaction system is based on the append-only nature
+/// of its core files. This exposes the necessary methods to safely write to
+/// the different core datastructures.
+pub trait Transaction {
+    /// Record the state of an append-only file before update
+    fn add(&mut self, file: impl AsRef<Path>, offset: usize);
+
+    // TODO the rest of the methods once we do more in Rust.
+}