B:BD[
6.6009] → [
2.80:186]
B:BD[
2.186] → [
2.186:213]
B:BD[
2.213] → [
2.213:221]
∅:D[
2.221] → [
6.6111:6177]
B:BD[
6.6111] → [
6.6111:6177]
B:BD[
6.6177] → [
2.222:312]
B:BD[
2.312] → [
2.312:549]
∅:D[
2.549] → [
6.6262:6302]
B:BD[
6.6262] → [
6.6262:6302]
B:BD[
6.6302] → [
2.550:659]
B:BD[
2.659] → [
2.659:779]
B:BD[
2.779] → [
2.779:809]
pub fn write_commit(
&mut self,
c: &Change,
parent: Option<libpijul::Merkle>,
files: &Vec<File>,
) {
let mut file_marks = Vec::new();
for f in files {
let content: &[u8] = &f.content;
let h = sha256::digest(content);
let mut new_blob = false;
let blob_mark = *self.blob_marks.entry(h).or_insert_with(|| {
new_blob = true;
self.max_blob_mark += 1;
self.max_blob_mark
});
file_marks.push(blob_mark);
if new_blob {
println!("blob");
println!("mark :{}", blob_mark);
println!("data {}", f.content.len());
std::io::stdout().write_all(&f.content).unwrap();
println!("");
pub fn write_commit(&mut self, c: &Change, parent: Option<libpijul::Merkle>, files: &FileSet) {
let mut file_marks = HashMap::new();
for op in &*files.operations.lock().unwrap() {
match &op {
FileOp::Modify { fw } => {
let ct = fw.content.lock().unwrap();
let content: &[u8] = &*ct;
let h = sha256::digest(content);
let mut new_blob = false;
let blob_mark = *self.blob_marks.entry(h).or_insert_with(|| {
new_blob = true;
self.max_blob_mark += 1;
self.max_blob_mark
});
file_marks.insert(fw.name.clone(), blob_mark);
if new_blob {
println!("blob");
println!("mark :{}", blob_mark);
println!("data {}", content.len());
std::io::stdout().write_all(content).unwrap();
println!("");
}
}
_ => (),