Fixing missing dependencies on partial clones

pmeunier
Mar 4, 2024, 7:13 PM
OGJFEWHUMFIZYBS456FPNUN3KEUDZXIJNFGPEMJGQDC7INZMHQZQC

Dependencies

  • [2] R7X3PDL6 Formatting
  • [3] ABQDWHNG Migrate from `pijul::repository` to `pijul-repository`
  • [4] PYTC7DPV Partial clones: including all the subtree of a directory when selecting patches
  • [5] A3RM526Y Integrating identity malleability
  • [6] 4XLHUME7 Fixing a interlocking when cloning from a particular patch
  • [7] TYAKEAJL A better estimate of the maximum number of open patches we can keep (Unix-only at the moment)
  • [8] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [9] C3L2TLQW When downloading changes, check whether we have their dependencies and download them too
  • [10] UDHP4ZVB Fixing SSH asynchronicity issues
  • [11] MU5GSJAW Partial push and pull (WARNING: breaks the existing protocol)
  • [12] JL4WKA5P Implement the Sanakirja concurrency model in a cross-process way
  • [13] L2VH4BYK Downloading changelists from channels without an id (Nest discussions)
  • [14] DO2Y5TY5 Tag synchronisation
  • [15] YN63NUZO Sanakirja 1.0
  • [16] ZWVYH7WP Pulling local tags
  • [17] EUZFFJSO Updating Pijul with the latest changes in Libpijul
  • [18] RUBBHYZ7 Removing unnecessary async/await
  • [19] S2B5MEWP Minor change in the type of sanakirja::GraphTxnT::Graph (prepare for more general backends)
  • [20] RM225IDQ Exchanging tagged states over SSH
  • [21] CCLLB7OI Upgrading to Sanakirja 0.15 + version bump
  • [22] ZBNKSYA6 Fixing a bus error when starting a transaction on a full disk
  • [23] I52XSRUH Massive cleanup, and simplification
  • [24] 4HTHYIA3 Fixing HTTP download
  • [25] XQHABMC2 Do not block when there is no patch to pull
  • [26] WZVCLZKY address clippy lints
  • [27] IBPVOKM5 Fixing a bug in patch download
  • [28] I24UEJQL Various post-fire fixes
  • [29] DDJO7X2P Remove dependency on `num_cpus`
  • [*] L4JXJHWX pijul/*: reorganize imports and remove extern crate

Change contents

  • replacement in pijul-remote/src/local.rs at line 71
    [5.80668][5.2125:2143]()
    mut f: F,
    [5.80668]
    [5.2143]
    f: F,
  • edit in pijul-remote/src/local.rs at line 76
    [5.4367][5.1024:1126](),[5.1126][3.722:766](),[5.417][5.1170:1181](),[3.766][5.1170:1181](),[5.1170][5.1170:1181]()
    let store = libpijul::changestore::filesystem::FileSystem::from_root(
    &self.root,
    pijul_repository::max_files()?,
    );
  • edit in pijul-remote/src/local.rs at line 86
    [5.81183]
    [5.4408]
    self.download_changelist_(f, a, from, paths, &remote_txn, &remote_channel)
    }
    pub fn download_changelist_<
    A,
    T: libpijul::ChannelTxnT + libpijul::TxnTExt + libpijul::DepsTxnT + libpijul::GraphTxnT,
    F: FnMut(&mut A, u64, Hash, Merkle, bool) -> Result<(), anyhow::Error>,
    >(
    &mut self,
    mut f: F,
    a: &mut A,
    from: u64,
    paths: &[String],
    remote_txn: &T,
    remote_channel: &ChannelRef<T>,
    ) -> Result<HashSet<Position<Hash>>, anyhow::Error> {
    let store = libpijul::changestore::filesystem::FileSystem::from_root(
    &self.root,
    pijul_repository::max_files()?,
    );
  • replacement in pijul-remote/src/local.rs at line 113
    [4.52][5.97:241](),[5.10438][5.97:241]()
    libpijul::fs::iter_graph_descendants(&remote_txn, &remote_channel.read(), p)?
    .map(|x| x.unwrap()),
    [4.52]
    [4.53]
    libpijul::fs::iter_graph_descendants(
    remote_txn,
    remote_txn.graph(&*remote_channel.read()),
    p,
    )?
    .map(|x| x.unwrap()),
  • replacement in pijul-remote/src/local.rs at line 138
    [5.21242][5.21242:21290](),[5.1033][5.10768:10802](),[5.1179][5.10768:10802](),[5.21290][5.10768:10802](),[5.10768][5.10768:10802](),[5.10802][5.8963:9223]()
    for x in remote_txn.log(&*rem, from)? {
    let (n, (h, m)) = x?;
    assert!(n >= from);
    let h_int = remote_txn.get_internal(h)?.unwrap();
    if paths_.is_empty()
    || paths_.iter().any(|x| {
    remote_txn
    .get_touched_files(x, Some(h_int))
    [5.21242]
    [5.9223]
    if paths_.is_empty() {
    for x in remote_txn.log(&*rem, from)? {
    debug!("log {:?}", x);
    let (n, (h, m)) = x?;
    assert!(n >= from);
    debug!("put_remote {:?} {:?} {:?}", n, h, m);
    if tags.get(tagsi) == Some(&n) {
    f(a, n, h.into(), m.into(), true)?;
    tagsi += 1;
    } else {
    f(a, n, h.into(), m.into(), false)?;
    }
    }
    } else {
    let mut hashes = HashMap::new();
    let mut stack = Vec::new();
    for x in remote_txn.log(&*rem, from)? {
    debug!("log {:?}", x);
    let (n, (h, m)) = x?;
    assert!(n >= from);
    let h_int = remote_txn.get_internal(h)?.unwrap();
    if paths_.is_empty()
    || paths_.iter().any(|x| {
    let y = remote_txn.get_touched_files(x, Some(h_int)).unwrap();
    debug!("x {:?} {:?}", x, y);
    y == Some(h_int)
    })
    {
    stack.push((*h_int, *m, n));
    }
    }
    while let Some((h_int, m, n)) = stack.pop() {
    if hashes.insert(h_int, (m, n)).is_some() {
    continue;
    }
    for d in remote_txn.iter_dep(&h_int)? {
    let (&h_int_, &d) = d?;
    if h_int_ < h_int {
    continue;
    } else if h_int_ > h_int {
    break;
    }
    let n = remote_txn
    .get_changeset(remote_txn.changes(&*rem), &d)
  • replacement in pijul-remote/src/local.rs at line 184
    [5.9257][5.9257:9325]()
    .is_some()
    })
    {
    [5.9257]
    [5.9325]
    .unwrap();
    let m = remote_txn
    .get_revchangeset(remote_txn.rev_changes(&*rem), &n)
    .unwrap()
    .unwrap()
    .b;
    stack.push((d, m.into(), (*n).into()))
    }
    }
    let mut hashes: Vec<_> = hashes.into_iter().collect();
    hashes.sort_by_key(|(_, (_, n))| *n);
    for (h_int, (m, n)) in hashes {
    let h = remote_txn.get_external(&h_int)?.unwrap();
  • edit in pijul-remote/src/local.rs at line 287
    [5.1245]
    [5.12157]
    libpijul::changestore::filesystem::pop_filename(&mut self.changes_dir);
  • replacement in pijul-remote/src/local.rs at line 289
    [5.12233][5.1463:1509]()
    send.send((c, false)).await?;
    [5.12233]
    [5.1246]
    send.send((c, true)).await?;
  • edit in pijul-remote/src/lib.rs at line 1348
    [5.478][5.1100:1156](),[5.1100][5.1100:1156]()
    let mut change_path = repo.changes_dir.clone();
  • edit in pijul-remote/src/lib.rs at line 1359
    [5.1522][5.1522:1702]()
    libpijul::changestore::filesystem::push_filename(&mut change_path, &hash);
    std::fs::create_dir_all(change_path.parent().unwrap())?;
  • edit in pijul-remote/src/lib.rs at line 1377
    [5.2570][5.2570:2661]()
    libpijul::changestore::filesystem::pop_filename(&mut change_path);
  • edit in pijul/src/commands/protocol.rs at line 5
    [31.1913]
    [31.1913]
    use std::sync::Arc;
  • replacement in pijul/src/commands/protocol.rs at line 56
    [5.15837][5.11368:11418]()
    let txn = repo.pristine.arc_txn_begin()?;
    [5.15837]
    [5.124930]
    let pristine = Arc::new(repo.pristine);
    let txn = pristine.arc_txn_begin()?;
  • replacement in pijul/src/commands/protocol.rs at line 129
    [5.126705][5.11321:11419]()
    let mut paths = HashSet::new();
    debug!("cap[3] = {:?}", &cap[3]);
    [5.126705]
    [5.11835]
    let mut paths = Vec::new();
  • replacement in pijul/src/commands/protocol.rs at line 131
    [5.11419][5.126749:126816](),[5.11873][5.126749:126816](),[5.126749][5.126749:126816](),[5.126816][5.11420:11484](),[5.11484][5.126875:127036](),[5.126875][5.126875:127036](),[5.127036][5.15583:15635]()
    for r in CHANGELIST_PATHS.captures_iter(&cap[3]) {
    let s: String = r[1].replace("\\\"", "\"");
    if let Ok((p, ambiguous)) = txn.follow_oldest_path(&repo.changes, &channel, &s)
    {
    if ambiguous {
    bail!("Ambiguous path")
    [5.11873]
    [5.127231]
    {
    for r in CHANGELIST_PATHS.captures_iter(&cap[3]) {
    let s: String = r[1].replace("\\\"", "\"");
    if let Ok((p, ambiguous)) =
    txn.follow_oldest_path(&repo.changes, &channel, &s)
    {
    if ambiguous {
    bail!("Ambiguous path")
    }
    let h: libpijul::Hash = txn.get_external(&p.change)?.unwrap().into();
    writeln!(o, "{}.{}", h.to_base32(), p.pos.0)?;
    paths.push(s);
    } else {
    debug!("protocol line: {:?}", buf);
    bail!("Protocol error")
  • edit in pijul/src/commands/protocol.rs at line 147
    [5.127257][5.12298:12392](),[5.12392][5.11554:11666](),[5.15706][5.11554:11666](),[5.11554][5.11554:11666](),[5.11666][5.15707:15745](),[5.15745][5.242:335](),[5.335][5.15845:15926](),[5.11973][5.15845:15926](),[5.17936][5.15845:15926](),[5.15845][5.15845:15926](),[5.11881][5.127295:127324](),[5.15926][5.127295:127324](),[5.127295][5.127295:127324](),[5.127324][5.15927:16035]()
    let h: libpijul::Hash = txn.get_external(&p.change)?.unwrap().into();
    writeln!(o, "{}.{}", h.to_base32(), p.pos.0)?;
    paths.insert(p);
    paths.extend(
    libpijul::fs::iter_graph_descendants(&*txn, &channel.read(), p)?
    .map(|x| x.unwrap()),
    );
    } else {
    debug!("protocol line: {:?}", buf);
    bail!("Protocol error")
  • edit in pijul/src/commands/protocol.rs at line 149
    [5.127543][5.11882:11929](),[5.11929][5.33763:33955]()
    debug!("paths = {:?}", paths);
    let tags: Vec<u64> = txn
    .iter_tags(txn.tags(&*channel.read()), from)?
    .map(|k| (*k.unwrap().0).into())
    .collect();
  • replacement in pijul/src/commands/protocol.rs at line 150
    [5.33990][5.11974:12034](),[5.11929][5.11974:12034](),[5.12034][5.16097:16202](),[5.17998][5.16097:16202](),[5.16097][5.16097:16202](),[5.16202][5.127675:127715](),[5.127675][5.127675:127715](),[5.127715][5.11930:11980](),[5.11980][5.12393:12532](),[5.12532][5.12078:12105](),[5.16342][5.12078:12105](),[5.12078][5.12078:12105](),[5.12105][5.127871:127893](),[5.127871][5.127871:127893](),[5.127893][5.12533:12631](),[5.12631][5.33991:34068]()
    for x in txn.log(&*channel.read(), from)? {
    let (n, (h, m)) = x?;
    let h_int = txn.get_internal(h)?.unwrap();
    if paths.is_empty()
    || paths.iter().any(|x| {
    x.change == *h_int
    || txn.get_touched_files(x, Some(h_int)).unwrap().is_some()
    })
    {
    let h: Hash = h.into();
    let m: Merkle = m.into();
    if paths.is_empty() && tags.get(tagsi) == Some(&n) {
    [5.33990]
    [2.0]
    (pijul_remote::local::Local {
    channel: (&cap[1]).to_string(),
    root: PathBuf::new(),
    changes_dir: PathBuf::new(),
    pristine: pristine.clone(),
    name: String::new(),
    })
    .download_changelist_(
    |_, n, h, m, is_tag| {
    if is_tag {
  • replacement in pijul/src/commands/protocol.rs at line 165
    [5.3473][5.127975:128015](),[5.127975][5.127975:128015]()
    }
    }
    [5.3473]
    [5.1616]
    Ok(())
    },
    &mut (),
    from,
    &paths,
    &*txn,
    &channel,
    )?;