Minor change in the type of sanakirja::GraphTxnT::Graph (prepare for more general backends)

pmeunier
Dec 6, 2021, 9:18 AM
S2B5MEWPPG4P6SL5NWTVAHPRJ6YPKX3VTRONYS267ZTTTPA6L3GAC

Dependencies

  • [2] IVLLXQ5Z Improved push/pull reporting
  • [3] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [4] MU5GSJAW Partial push and pull (WARNING: breaks the existing protocol)
  • [5] 2RXOCWUW Making libpijul deterministic (and getting rid of `rand`)
  • [6] GUL4M5FI Cleanup and formatting
  • [7] 5OGOE4VW Store the current channel in the pristine
  • [8] DJYHARZ7 Skipping old files when recording
  • [9] I24UEJQL Various post-fire fixes
  • [10] TKEVOH7H Fixing a bug when downloading changes, and making change download more efficient (more async)
  • [11] 3AMEP2Y5 More convenient interface for channels
  • [12] YN63NUZO Sanakirja 1.0
  • [13] GHO6DWPI Refactoring iterators
  • [14] DF23IIGW New method to iterate on a graph: libpijul::pristine::GraphIter::iter_graph
  • [15] CCLLB7OI Upgrading to Sanakirja 0.15 + version bump
  • [16] YD7QFAD7 Simplifying pijul::remote::PushDelta
  • [17] A3RM526Y Integrating identity malleability
  • [18] EUZFFJSO Updating Pijul with the latest changes in Libpijul
  • [19] BZCGXVS7 Fixing two bugs around conflicts on the last line, where invalid patches were produced (first bug) and applied (second bug)

Change contents

  • replacement in pijul/src/remote/mod.rs at line 139
    [2.739][2.739:858]()
    libpijul::fs::iter_graph_descendants(txn, &channel.read().graph, p)?
    .map(|x| x.unwrap()),
    [2.739]
    [2.858]
    libpijul::fs::iter_graph_descendants(txn, &channel.read(), p)?.map(|x| x.unwrap()),
  • replacement in pijul/src/remote/local.rs at line 87
    [3.10438][3.10438:10533](),[3.10533][3.1058:1112](),[3.965][3.10589:10681](),[3.1112][3.10589:10681](),[3.10589][3.10589:10681]()
    libpijul::fs::iter_graph_descendants(
    &remote_txn,
    &remote_channel.read().graph,
    p,
    )?
    .map(|x| x.unwrap()),
    [3.10438]
    [3.10681]
    libpijul::fs::iter_graph_descendants(&remote_txn, &remote_channel.read(), p)?
    .map(|x| x.unwrap()),
  • replacement in pijul/src/commands/protocol.rs at line 119
    [3.15745][3.11874:11973]()
    libpijul::fs::iter_graph_descendants(&*txn, &channel.read().graph, p)?
    [3.15745]
    [3.15845]
    libpijul::fs::iter_graph_descendants(&*txn, &channel.read(), p)?
  • replacement in pijul/src/commands/debug.rs at line 48
    [3.21604][3.16478:16521]()
    &channel.read().graph,
    [3.21604]
    [3.21648]
    &channel.read(),
  • replacement in pijul/src/commands/debug.rs at line 55
    [3.16568][3.21841:21926](),[3.21841][3.21841:21926]()
    libpijul::pristine::debug(&txn, &channel.graph, std::io::stdout())?;
    [3.16568]
    [3.21926]
    libpijul::pristine::debug(&txn, &channel, std::io::stdout())?;
  • replacement in libpijul/src/pristine/sanakirja.rs at line 365
    [3.5811][3.64728:64783](),[3.64728][3.64728:64783]()
    type Graph = Db<Vertex<ChangeId>, SerializedEdge>;
    [3.5811]
    [3.39879]
    type Graph = Channel;
  • replacement in libpijul/src/pristine/sanakirja.rs at line 368
    [3.39918][3.64784:64857]()
    sanakirja_get!(graph, Vertex<ChangeId>, SerializedEdge, GraphError);
    [3.39918]
    [3.64857]
    fn get_graph<'txn>(
    &'txn self,
    db: &Self::Graph,
    key: &Vertex<ChangeId>,
    value: Option<&SerializedEdge>,
    ) -> Result<Option<&'txn SerializedEdge>, TxnErr<Self::GraphError>> {
    match ::sanakirja::btree::get(&self.txn, &db.graph, key, value) {
    Ok(Some((k, v))) if k == key => Ok(Some(v)),
    Ok(_) => Ok(None),
    Err(e) => {
    error!("{:?}", e);
    Err(TxnErr(SanakirjaError::PristineCorrupt))
    }
    }
    }
  • replacement in libpijul/src/pristine/sanakirja.rs at line 432
    [3.65990][3.65990:66074]()
    let mut cursor = btree::cursor::Cursor::new(&self.txn, g).map_err(TxnErr)?;
    [3.65990]
    [3.66074]
    let mut cursor = btree::cursor::Cursor::new(&self.txn, &g.graph).map_err(TxnErr)?;
  • replacement in libpijul/src/pristine/sanakirja.rs at line 455
    [3.66415][3.31604:31644](),[3.31604][3.31604:31644]()
    find_block(&self.txn, graph, p)
    [3.66415]
    [3.31644]
    find_block(&self.txn, &graph.graph, p)
  • replacement in libpijul/src/pristine/sanakirja.rs at line 463
    [3.66483][3.31815:31859](),[3.31815][3.31815:31859]()
    find_block_end(&self.txn, graph, p)
    [3.66483]
    [3.31859]
    find_block_end(&self.txn, &graph.graph, p)
  • replacement in libpijul/src/pristine/sanakirja.rs at line 651
    [3.3493][3.3493:3570]()
    let mut c = ::sanakirja::btree::cursor::Cursor::new(&self.txn, &g)?;
    [3.3493]
    [3.3570]
    let mut c = ::sanakirja::btree::cursor::Cursor::new(&self.txn, &g.graph)?;
  • replacement in libpijul/src/pristine/sanakirja.rs at line 708
    [3.40642][3.70593:70685](),[3.2104][3.39313:39330](),[3.70685][3.39313:39330](),[3.39313][3.39313:39330]()
    fn graph<'a>(&self, c: &'a Self::Channel) -> &'a Db<Vertex<ChangeId>, SerializedEdge> {
    &c.graph
    [3.40642]
    [3.39330]
    fn graph<'a>(&self, c: &'a Self::Channel) -> &'a Channel {
    c
  • replacement in libpijul/src/pristine/sanakirja.rs at line 1496
    [3.64393][3.82408:82460](),[3.50063][3.82408:82460]()
    Ok(btree::put(&mut self.txn, graph, k, e)?)
    [3.50063]
    [3.559101]
    Ok(btree::put(&mut self.txn, &mut graph.graph, k, e)?)
  • replacement in libpijul/src/pristine/sanakirja.rs at line 1505
    [3.50114][3.1944:1996]()
    Ok(btree::del(&mut self.txn, graph, k, e)?)
    [3.50114]
    [3.66261]
    Ok(btree::del(&mut self.txn, &mut graph.graph, k, e)?)
  • replacement in libpijul/src/pristine/sanakirja.rs at line 1511
    [3.66390][3.66390:66412]()
    &[graph],
    [3.66390]
    [3.66412]
    &[&graph.graph],
  • replacement in libpijul/src/pristine/sanakirja.rs at line 1529
    [3.66][3.82799:82871]()
    let mut cursor = btree::cursor::Cursor::new(&self.txn, graph)?;
    [3.66]
    [3.82871]
    let mut cursor = btree::cursor::Cursor::new(&self.txn, &graph.graph)?;
  • replacement in libpijul/src/pristine/sanakirja.rs at line 1596
    [3.47691][3.47691:47712]()
    &mut c.graph
    [3.47691]
    [3.47712]
    c