Exchanging tagged states over SSH

pmeunier
Dec 17, 2021, 9:45 PM
RM225IDQR36MNBMN7OT2R562M4FUD6L34RY7A3WDBBETZIIDKZ5AC

Dependencies

  • [2] K4CVMIUK Do not present changes we know as "unknown" on the remote
  • [3] 7HOBLRD4 Fixing remote push/pull
  • [4] YN63NUZO Sanakirja 1.0
  • [5] VO5OQW4W Removing anyhow in libpijul
  • [6] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [7] A3RM526Y Integrating identity malleability
  • [8] 76PCXGML Pushing to, and pulling from the local repository
  • [9] L2VH4BYK Downloading changelists from channels without an id (Nest discussions)
  • [10] WZVCLZKY address clippy lints
  • [11] CCLLB7OI Upgrading to Sanakirja 0.15 + version bump
  • [12] TPEH2XNB 1.0.0-alpha.28, with Tokio 1.0
  • [13] 27RZYCM3 Pushing/pulling from/to Nest discussions again
  • [14] IVLLXQ5Z Improved push/pull reporting
  • [15] 2GQCLJZG Displaying errors returned by the server in the protocol
  • [16] JRENVH5D Reqwest 0.11
  • [17] MU5GSJAW Partial push and pull (WARNING: breaks the existing protocol)
  • [18] YD7QFAD7 Simplifying pijul::remote::PushDelta
  • [19] 3ZAS64J6 Solving conflicts
  • [*] FBXYP7QM Forgot to add remote::http

Change contents

  • replacement in pijul/src/remote/ssh.rs at line 849
    [4.251][4.251:335]()
    F: FnMut(&mut A, u64, Hash, libpijul::Merkle) -> Result<(), anyhow::Error>,
    [4.251]
    [4.335]
    F: FnMut(&mut A, u64, Hash, libpijul::Merkle, bool) -> Result<(), anyhow::Error>,
  • replacement in pijul/src/remote/ssh.rs at line 875
    [4.528][4.381:452]()
    super::ListLine::Change { n, h, m } => f(a, n, h, m)?,
    [4.528]
    [4.659]
    super::ListLine::Change { n, h, m, is_tagged } => f(a, n, h, m, is_tagged)?,
  • edit in pijul/src/remote/mod.rs at line 190
    [4.2927]
    [4.2927]
    pub tags: HashSet<Merkle>,
  • replacement in pijul/src/remote/mod.rs at line 196
    [4.3195][4.3195:3250]()
    pub theirs_ge_dichotomy: Vec<(u64, Hash, Merkle)>,
    [4.3195]
    [4.3250]
    pub theirs_ge_dichotomy: Vec<(u64, Hash, Merkle, bool)>,
  • replacement in pijul/src/remote/mod.rs at line 289
    [4.6984][4.6984:7022]()
    .filter_map(|(_, h, _)| {
    [4.6984]
    [2.0]
    .filter_map(|(_, h, _, _)| {
  • replacement in pijul/src/remote/mod.rs at line 324
    [3.316][3.316:352]()
    to_download.push(h)
    [3.316]
    [3.352]
    to_download.push(h);
  • edit in pijul/src/remote/mod.rs at line 330
    [3.402]
    [4.8241]
    tags: HashSet::new(),
  • edit in pijul/src/remote/mod.rs at line 345
    [4.8828]
    [4.8828]
    let mut tags = HashSet::new();
  • replacement in pijul/src/remote/mod.rs at line 349
    [4.9021][4.9021:9056]()
    let (h, m) = x?.1;
    [4.9021]
    [4.9056]
    let (n, (h, m)) = x?;
  • replacement in pijul/src/remote/mod.rs at line 368
    [4.9776][4.9776:9827]()
    to_download.push(h.into())
    [4.9776]
    [4.9827]
    to_download.push(h.into());
    if txn.is_tagged(&remote_channel.tags, n)? {
    tags.insert(m.into());
    }
  • edit in pijul/src/remote/mod.rs at line 379
    [4.9961]
    [4.9961]
    tags,
  • replacement in pijul/src/remote/mod.rs at line 522
    [4.563][4.563:621]()
    for (_, h, _) in theirs_ge_dichotomy.iter() {
    [4.563]
    [4.621]
    let mut tags = HashSet::new();
    for (_, h, m, is_tagged) in theirs_ge_dichotomy.iter() {
  • edit in pijul/src/remote/mod.rs at line 527
    [3.654]
    [3.654]
    if *is_tagged {
    tags.insert(*m);
    }
  • edit in pijul/src/remote/mod.rs at line 536
    [4.848]
    [4.848]
    tags,
  • replacement in pijul/src/remote/mod.rs at line 576
    [4.12796][4.12796:12828]()
    .map(|(_, h, _)| h)
    [4.12796]
    [4.12828]
    .map(|(_, h, _, _)| h)
  • replacement in pijul/src/remote/mod.rs at line 598
    [4.13766][4.13766:13894]()
    for (n, h, m) in theirs_ge_dichotomy.iter().copied() {
    txn.put_remote(&mut remote_ref, n, (h, m))?;
    [4.13766]
    [4.13894]
    for (n, h, m, t) in theirs_ge_dichotomy.iter().copied() {
    txn.put_remote(&mut remote_ref, n, (h, m, t))?;
  • edit in pijul/src/remote/mod.rs at line 631
    [4.15184]
    [4.15184]
    tags: HashSet::new(),
  • replacement in pijul/src/remote/mod.rs at line 639
    [4.15437][4.15437:15783]()
    for thing in txn.iter_remote(&remote_ref.lock().remote, 0)? {
    let (_, libpijul::pristine::Pair { a: hash, b: merkle }) = thing?;
    if state_cond(txn, &merkle)? {
    break;
    } else if change_cond(txn, &hash.into()) {
    to_download.push(Hash::from(hash));
    [4.15437]
    [4.15783]
    let mut tags = HashSet::new();
    {
    let rem = remote_ref.lock();
    for thing in txn.iter_remote(&rem.remote, 0)? {
    let (n, libpijul::pristine::Pair { a: hash, b: merkle }) = thing?;
    if state_cond(txn, &merkle)? {
    break;
    } else if change_cond(txn, &hash.into()) {
    to_download.push(Hash::from(hash));
    if txn.is_tagged(&rem.tags, (*n).into())? {
    tags.insert(merkle.into());
    }
    }
  • edit in pijul/src/remote/mod.rs at line 654
    [4.15815][4.15815:15816]()
  • edit in pijul/src/remote/mod.rs at line 658
    [4.15944]
    [4.15944]
    tags,
  • replacement in pijul/src/remote/mod.rs at line 676
    [4.16649][4.16649:16709]()
    for (_, hash, merkle) in &theirs_ge_dichotomy {
    [4.16649]
    [4.16709]
    let mut tags = HashSet::new();
    for (_, hash, merkle, t) in &theirs_ge_dichotomy {
  • edit in pijul/src/remote/mod.rs at line 682
    [4.16902]
    [4.16902]
    if *t {
    tags.insert(*merkle);
    }
  • edit in pijul/src/remote/mod.rs at line 692
    [4.17063]
    [4.17063]
    tags,
  • replacement in pijul/src/remote/mod.rs at line 708
    [4.17557][4.17557:17643]()
    ) -> Result<(HashSet<Position<Hash>>, Vec<(u64, Hash, Merkle)>), anyhow::Error> {
    [4.17557]
    [4.17643]
    ) -> Result<(HashSet<Position<Hash>>, Vec<(u64, Hash, Merkle, bool)>), anyhow::Error> {
  • replacement in pijul/src/remote/mod.rs at line 710
    [4.17675][4.17675:17737]()
    let f = |v: &mut Vec<(u64, Hash, Merkle)>, n, h, m| {
    [4.17675]
    [4.17737]
    let f = |v: &mut Vec<(u64, Hash, Merkle, bool)>, n, h, m, t| {
  • replacement in pijul/src/remote/mod.rs at line 712
    [4.17778][4.17778:17812]()
    Ok(v.push((n, h, m)))
    [4.17778]
    [4.17812]
    Ok(v.push((n, h, m, t)))
  • replacement in pijul/src/remote/mod.rs at line 857
    [4.1161][4.453:518]()
    let f = |a: &mut (&mut T, &mut RemoteRef<T>), n, h, m| {
    [4.1161]
    [4.518]
    let f = |a: &mut (&mut T, &mut RemoteRef<T>), n, h, m, is_tagged| {
  • replacement in pijul/src/remote/mod.rs at line 859
    [4.570][4.570:618]()
    txn.put_remote(remote, n, (h, m))?;
    [4.570]
    [4.618]
    txn.put_remote(remote, n, (h, m, is_tagged))?;
  • replacement in pijul/src/remote/mod.rs at line 1291
    [4.2996][4.2996:3137]()
    static ref CHANGELIST_LINE: Regex =
    Regex::new(r#"(?P<num>[0-9]+)\.(?P<hash>[A-Za-z0-9]+)\.(?P<merkle>[A-Za-z0-9]+)"#).unwrap();
    [4.2996]
    [4.3137]
    static ref CHANGELIST_LINE: Regex = Regex::new(
    r#"(?P<num>[0-9]+)\.(?P<hash>[A-Za-z0-9]+)\.(?P<merkle>[A-Za-z0-9]+)(?P<tag>\.)?"#
    )
    .unwrap();
  • replacement in pijul/src/remote/mod.rs at line 1300
    [4.3266][4.3266:3309]()
    Change { n: u64, h: Hash, m: Merkle },
    [4.3266]
    [4.3309]
    Change {
    n: u64,
    h: Hash,
    m: Merkle,
    is_tagged: bool,
    },
  • edit in pijul/src/remote/mod.rs at line 1321
    [4.3818]
    [4.3818]
    is_tagged: caps.name("tag").is_some(),
  • replacement in pijul/src/remote/local.rs at line 56
    [4.2043][4.2043:2117]()
    F: FnMut(&mut A, u64, Hash, Merkle) -> Result<(), anyhow::Error>,
    [4.2043]
    [4.2117]
    F: FnMut(&mut A, u64, Hash, Merkle, bool) -> Result<(), anyhow::Error>,
  • replacement in pijul/src/remote/local.rs at line 109
    [4.9387][4.2163:2209]()
    f(a, n, h.into(), m.into())?;
    [4.9387]
    [4.82051]
    f(
    a,
    n,
    h.into(),
    m.into(),
    remote_txn.is_tagged(&remote_channel.read().tags, n)?,
    )?;
  • replacement in pijul/src/remote/http.rs at line 223
    [4.2324][4.2324:2408]()
    F: FnMut(&mut A, u64, Hash, libpijul::Merkle) -> Result<(), anyhow::Error>,
    [4.2324]
    [4.2408]
    F: FnMut(&mut A, u64, Hash, libpijul::Merkle, bool) -> Result<(), anyhow::Error>,
  • replacement in pijul/src/remote/http.rs at line 269
    [4.6079][4.2454:2533]()
    super::ListLine::Change { n, m, h } => f(a, n, h, m)?,
    [4.6079]
    [4.6234]
    super::ListLine::Change { n, m, h, is_tagged } => f(a, n, h, m, is_tagged)?,
  • replacement in pijul/src/commands/protocol.rs at line 140
    [4.12631][4.127893:127975](),[4.127893][4.127893:127975]()
    writeln!(o, "{}.{}.{}", n, h.to_base32(), m.to_base32())?
    [4.12631]
    [4.127975]
    if txn.is_tagged(&channel.read().tags, n)? {
    writeln!(o, "{}.{}.{}.", n, h.to_base32(), m.to_base32())?
    } else {
    writeln!(o, "{}.{}.{}", n, h.to_base32(), m.to_base32())?
    }
  • edit in libpijul/src/pristine/sanakirja.rs at line 1308
    [4.27343]
    [4.27343]
    tags: Db::from_page(remote.tags.into()),
  • edit in libpijul/src/pristine/sanakirja.rs at line 1438
    [4.28441]
    [4.28441]
    tags: Db::from_page(remote.tags.into()),
  • replacement in libpijul/src/pristine/sanakirja.rs at line 1786
    [4.562292][4.562292:562319]()
    v: (Hash, Merkle),
    [4.562292]
    [4.52484]
    v: (Hash, Merkle, bool),
  • edit in libpijul/src/pristine/sanakirja.rs at line 1798
    [4.86001]
    [4.86001]
    if v.2 {
    btree::put(&mut self.txn, &mut remote.tags, &k.into(), &())?;
    }
  • edit in libpijul/src/pristine/sanakirja.rs at line 2070
    [4.30809]
    [4.30809]
    tags: Db::from_page(remote.tags.into()),
  • edit in libpijul/src/pristine/sanakirja.rs at line 2082
    [4.30955]
    [4.30955]
    tags: btree::create_db(&mut self.txn)?,
  • edit in libpijul/src/pristine/mod.rs at line 121
    [4.34840]
    [4.34840]
    tags: L64,
  • edit in libpijul/src/pristine/mod.rs at line 239
    [4.35369]
    [4.35369]
    pub tags: T::Tags,
  • replacement in libpijul/src/pristine/mod.rs at line 1872
    [4.638332][4.638332:638359]()
    v: (Hash, Merkle),
    [4.638332]
    [4.74624]
    v: (Hash, Merkle, bool),