OXYGENHUB

A commit's graph keys from the state it extended 8457a6cc6984

After a commit, the manifest's graph keys came from loading the new
base's history again (0.5 s and a tree view on the Linux tree). They now
come from the state the commit already extended: a file whose graph it
built has no key and is read by the next snapshot, and a key the next
base does not share is simply not trusted. A one-file commit on the
Linux tip takes 3.1 s (from 4.7 s).

refs #35
Author
Andy McCall @andymccall <[email protected]>
When
· 2026-09-30 05:34 UTC
Signature
✔ signed by Andy McCall
Hash
8457a6cc6984a1797e45de459316403306ec4c6e4d30427d7ff0bf68caff4fa7
Depends on
86e1824f2d0b 982864068a59
Depended on by
236f35c0baba f9466021286a 1966f5db15ee
In bookmarks
agents-in-readme bare-hashes carried-not-removed carry-identical doctor-trust identical-sides keyless-tags main merge-remote-bookmark only-help-103 paths-for-resolutions-and-amend push-notes show-stat subrepo-pin-state switch-says
In tags
v0.1.0 v0.10.0 v0.11.0 v0.2.0 v0.3.0 v0.3.1 v0.4.0 v0.4.1 v0.4.2 v0.4.3 v0.4.4 v0.4.5 v0.4.6 v0.5.0 v0.5.1 v0.6.0 v0.7.0 v0.8.0 v0.9.0
Edits
6 atoms, 0 tree operations, 1 file

Browse the tree at this change

modified crates/oxy-core/src/repo/snapshot.rs +9 −6
…
539 unchanged lines
540 540
    /// The graph key of each text file of the state at `heads`, by path,
541 541
    /// from a history-only load that builds no graph. Files with an `eol`
542 542
    /// attribute are left out: their bytes on disk are not the rendering.
543 -
    fn committed_graph_keys(&self, heads: &[ChangeHash]) -> Result<HashMap<String, String>> {
543 +
    fn committed_graph_keys(&self, st: &State) -> HashMap<String, String> {
544 544
        let _t = crate::timing::phase("commit: graph keys");
545 -
        let st = self.load_state_history(heads)?;
546 545
        let attrs = self.disk_attributes();
547 -
        Ok(st
548 -
            .tree()
546 +
        st.tree()
549 547
            .view()
550 548
            .entries
551 549
            .iter()
…
4 unchanged lines
556 554
                let k = st.graph_key(&e.node)?;
557 555
                Some((p.clone(), crate::hash::ObjectRef(k).to_hex()))
558 556
            })
559 -
            .collect())
557 +
            .collect()
560 558
    }
561 559
562 560
    pub fn commit_selection(
…
159 unchanged lines
722 720
        wc_base.push(hash);
723 721
        let wc_base = st.maximal(&wc_base);
724 722
723 +
        // The graph keys of the files as they now are, from the state the
724 +
        // commit just extended: a file whose graph it built has none, and
725 +
        // is read by the next snapshot; a key the next base does not share
726 +
        // (the bookmark held other heads) is simply not trusted then.
727 +
        let committed_keys = (!partial).then(|| self.committed_graph_keys(&st));
725 728
        let wc = self.new_working_copy(wc_base, "");
726 729
        let wc_hash = self.store.put_change(&wc)?;
727 730
        let mut view = op.view.clone();
…
14 unchanged lines
742 745
            let keys = if conflicted {
743 746
                HashMap::new()
744 747
            } else {
745 -
                self.committed_graph_keys(&wc.deps).unwrap_or_default()
748 +
                committed_keys.unwrap_or_default()
746 749
            };
747 750
            self.rewrite_manifest(conflicted, false, &keys)?;
748 751
        }
…
1592 unchanged lines