aboutsummaryrefslogtreecommitdiffstats
path: root/lib/disk.ml
diff options
context:
space:
mode:
authorMarcos Magueta <maguetamarcos@gmail.com>2025-03-22 20:55:14 -0300
committerMarcos Magueta <maguetamarcos@gmail.com>2025-03-22 20:55:14 -0300
commit3b4556e23f19272e0f63d316842c887365676568 (patch)
tree5de00230226bc2297274a6f618a726b16e0a5f8c /lib/disk.ml
parentfb0ade9daf1e9d1cd0a29dd1abe87468ab03a174 (diff)
downloadSakura-3b4556e23f19272e0f63d316842c887365676568.tar.gz
Sakura-3b4556e23f19272e0f63d316842c887365676568.zip
fix commit updates
Diffstat (limited to 'lib/disk.ml')
-rw-r--r--lib/disk.ml16
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/disk.ml b/lib/disk.ml
index 7d53f77..9742216 100644
--- a/lib/disk.ml
+++ b/lib/disk.ml
@@ -80,8 +80,8 @@ module FileSystem (C : Configuration) : FileSystem = struct
end
module Executor = struct
- module StringMap = Map.Make (String)
- module IntMap = Map.Make (Int64)
+ module StringMap = Map.Make (String) [@@deriving show]
+ module IntMap = Map.Make (Int64) [@@deriving show]
module FS = FileSystem (DevelopmentConfiguration)
module Location = struct
@@ -388,17 +388,16 @@ module Command = struct
commit.references
in
Ok
- ( (commit, locations, references),
+ ( ({ commit with references }, locations),
ComputedHash computed_hash_handle )
| Some _, None ->
Error "Cannot write an entity without its referential."
- | None, _ -> Ok ((commit, locations, commit.references), Nothing))
+ | None, _ -> Ok ((commit, locations), Nothing))
| READ ->
let relation_name =
List.hd @@ String.split_on_char '/' command.filename
in
- print_endline "READ";
- print_endline relation_name;
+ print_endline @@ "READ: " ^ relation_name;
let entities : string list Executor.IntMap.t =
print_endline command.filename;
Executor.StringMap.find_opt command.filename commit.references
@@ -413,6 +412,8 @@ module Command = struct
let content =
Executor.IntMap.fold
(fun key hashes acc ->
+ print_string "KEY: ";
+ print_endline @@ Int64.to_string key;
( key,
List.map
(fun location ->
@@ -423,6 +424,7 @@ module Command = struct
in
(* print_string "CONTENT: "; *)
(* print_endline @@ Bytes.to_string content; *)
- Ok ((commit, locations, commit.references), Read content)
+ print_endline "------------------";
+ Ok ((commit, locations), Read content)
| _ -> Error "Unimplemented method"
end