Add local file conflict metadata

This commit is contained in:
Eric Wendland 2026-05-18 03:57:26 +02:00
commit 20c88af800
13 changed files with 673 additions and 15 deletions

View file

@ -1,5 +1,5 @@
use geth_auth::{AuthExplanation, AuthOp};
use geth_cas::{FileRoot, FileRootScan};
use geth_cas::{FileConflict, FileRoot, FileRootScan};
use geth_db::{CrSqliteChangeBatch, DbResource};
use geth_document::{DocumentResource, DocumentState};
use geth_keychain::KeychainOp;
@ -56,6 +56,23 @@ pub enum ControlRequest {
CasRootScan {
name: String,
},
CasConflictRecord {
root: String,
path: String,
kind: String,
detail: String,
base_tree: Option<BlobHash>,
local_tree: Option<BlobHash>,
remote_tree: Option<BlobHash>,
},
CasConflictList {
root: Option<String>,
},
CasConflictResolve {
conflict_id: String,
resolution: String,
note: Option<String>,
},
KeychainInit {
admin_key_path: Option<PathBuf>,
},
@ -227,6 +244,15 @@ pub enum ControlResponse {
CasRootScanned {
scan: FileRootScan,
},
CasConflictRecorded {
conflict: FileConflict,
},
CasConflictList {
conflicts: Vec<FileConflict>,
},
CasConflictResolved {
conflict: FileConflict,
},
KeychainStatus(KeychainStatusResponse),
KeychainInitialized {
ops: Vec<KeychainOp>,
@ -472,5 +498,15 @@ mod tests {
decode_request(&encode_request(&request).expect("encode")).expect("decode"),
request
);
let request = ControlRequest::CasConflictResolve {
conflict_id: "file-conflict:notes:1".to_owned(),
resolution: "keep-local".to_owned(),
note: Some("local file is authoritative".to_owned()),
};
assert_eq!(
decode_request(&encode_request(&request).expect("encode")).expect("decode"),
request
);
}
}