F6V27C3M7GZHBHXMGAZMYO5XGWDYYNNIF2HLDE2VPNHTEVDSYGVQC
7MNTFTDF62XHPRL56GJLTGRVB6QOLYDRYGY2XOKDO745RXOCBB4QC
I24UEJQLCH2SOXA4UHIYWTRDCHSOPU7AFTRUOTX7HZIAV4AZKYEQC
SXEYMYF7P4RZMZ46WPL4IZUTSQ2ATBWYZX7QNVMS3SGOYXYOHAGQC
YDTN6BGI5TFRJFM3N3Y2J463GKFHU5L3DPBQXBDIQJDWXU5ELKMQC
DJYHARZ7CSRMX6ZFM6P52SM2EC57VTSHWAIMFSD7Q3EL7UYZGLXQC
YN63NUZO4LVJ7XPMURDULTXBVJKW5MVCTZ24R7Z52QMHO3HPDUVQC
VE2UWMW42VWMOYZWJCJZBX4NYJO37E6WNISFBUXZFLQ5HWN3B4VQC
G6S6PWZEFJK7ARWBIFKDU6VYC5DCJ2YFJMWZOLLWWKU52R2QPXZAC
MFTN7GBWZNQAFHKER57MLZAJGVEAHV2GYAQN2QTDHTPCEURDVIGQC
JL4WKA5PBKXRNAMETYO4I52QKASQ3COYHH2JKGA7W5YLIRZZH53AC
I52XSRUH5RVHQBFWVMAQPTUSPAJ4KNVID2RMI3UGCVKFLYUO6WZAC
if let Some((txn, mut change, updates, hash, oldest)) = result {
let hash = hash.unwrap();
if sign {
let mut key_path = dirs_next::home_dir().unwrap().join(".ssh");
match sign_hash(&mut key_path, hash).await? {
Some((pk, signature)) if !signature.is_empty() => {
let sig = toml::Value::try_from(vec![Signature {
public_key: pk,
timestamp: change.header.timestamp,
signature,
}])?;
let mut toml = toml::map::Map::new();
toml.insert("signatures".to_string(), sig);
change.unhashed = Some(toml.into());
let hash2 = repo.changes.save_change(&change).unwrap();
assert_eq!(hash2, hash);
match result {
Either::A((txn, mut change, updates, hash, oldest)) => {
let hash = hash.unwrap();
if sign {
let mut key_path = dirs_next::home_dir().unwrap().join(".ssh");
match sign_hash(&mut key_path, hash).await? {
Some((pk, signature)) if !signature.is_empty() => {
let sig = toml::Value::try_from(vec![Signature {
public_key: pk,
timestamp: change.header.timestamp,
signature,
}])?;
let mut toml = toml::map::Map::new();
toml.insert("signatures".to_string(), sig);
change.unhashed = Some(toml.into());
let hash2 = repo.changes.save_change(&change).unwrap();
assert_eq!(hash2, hash);
}
_ => {
bail!("Could not sign the change");
}
}
let mut txn = if let Ok(txn) = Arc::try_unwrap(txn) {
txn.into_inner().unwrap()
} else {
unreachable!()
};
txn.apply_local_change(&mut channel, &change, &hash, &updates)?;
writeln!(stdout, "Hash: {}", hash.to_base32())?;
debug!("oldest = {:?}", oldest);
if no_prefixes {
let mut oldest = oldest
.duration_since(std::time::SystemTime::UNIX_EPOCH)
.unwrap()
.as_secs() as u64;
if oldest == 0 {
// If no diff was done at all, it means that no
// existing file changed since last time (some
// files may have been added, deleted or moved,
// but `touch` isn't about those).
oldest = std::time::SystemTime::now()
let mut txn = if let Ok(txn) = Arc::try_unwrap(txn) {
txn.into_inner().unwrap()
} else {
unreachable!()
};
txn.apply_local_change(&mut channel, &change, &hash, &updates)?;
writeln!(stdout, "Hash: {}", hash.to_base32())?;
debug!("oldest = {:?}", oldest);
if no_prefixes {
let mut oldest = oldest
if oldest == 0 {
// If no diff was done at all, it means that no
// existing file changed since last time (some
// files may have been added, deleted or moved,
// but `touch` isn't about those).
oldest = std::time::SystemTime::now()
.duration_since(std::time::SystemTime::UNIX_EPOCH)
.unwrap()
.as_secs() as u64;
}
txn.touch_channel(&mut *channel.write()?, Some(oldest));
txn.touch_channel(&mut *channel.write()?, Some(oldest));
txn.commit()?;
}
Either::B(txn) => {
if no_prefixes {
let mut txn = if let Ok(txn) = Arc::try_unwrap(txn) {
txn.into_inner().unwrap()
} else {
unreachable!()
};
txn.touch_channel(&mut *channel.write()?, None);
txn.commit()?;
}
writeln!(stderr, "Nothing to record")?;
txn.commit()?;
} else {
writeln!(stderr, "Nothing to record")?;
let mut txn = if let Ok(txn) = Arc::try_unwrap(txn) {
txn.into_inner().unwrap()
} else {
unreachable!()
};
txn.touch_channel(&mut *channel.write()?, None);
txn.commit()?;
return Ok(None);
return Ok(Either::B(txn));
result.oldest_change = result.oldest_change.min(rec.oldest_change);
if result.oldest_change == std::time::UNIX_EPOCH
|| (rec.oldest_change > std::time::UNIX_EPOCH
&& rec.oldest_change < result.oldest_change)
{
result.oldest_change = rec.oldest_change
}