Fixing a bug in unrecord

[?]
May 9, 2021, 8:59 PM
IXC43DSHDSXCE2X6H6N47GGVKTYM2D2BUUWF34CFWMFT6Z45NOOAC

Dependencies

  • [2] I24UEJQL Various post-fire fixes
  • [3] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [4] VO5OQW4W Removing anyhow in libpijul
  • [5] GHO6DWPI Refactoring iterators
  • [6] CCLLB7OI Upgrading to Sanakirja 0.15 + version bump
  • [7] 6YMDOZIB Refactoring apply
  • [*] YN63NUZO Sanakirja 1.0
  • [*] 23LVKATN Use pager crate for log output

Change contents

  • edit in libpijul/src/unrecord/mod.rs at line 230
    [9.16786]
    [3.235977]
    must_reintroduce: HashSet<(Vertex<ChangeId>, Vertex<ChangeId>)>,
  • edit in libpijul/src/unrecord/mod.rs at line 369
    [9.17932]
    [3.240757]
    ws.must_reintroduce.clear();
    for n in newedges.edges.iter() {
    let mut source = crate::apply::edge::find_source_vertex(txn, channel, &n.from, change_id, newedges.inode, n.flag, &mut ws.apply)?;
    let mut target = crate::apply::edge::find_target_vertex(txn, channel, &n.to, change_id, newedges.inode, n.flag, &mut ws.apply)?;
    loop {
    let intro_ext = n.introduced_by.unwrap_or(ext);
    let intro = internal(txn, &n.introduced_by, change_id)?.unwrap();
    if must_reintroduce(txn, channel, changes, source, target, intro_ext, intro, change_id)? {
    ws.must_reintroduce.insert((source, target));
    }
    if target.end >= n.to.end {
    break;
    }
    source = target;
    target = *txn
    .find_block(channel, target.end_pos())
    .map_err(UnrecordError::from)?;
    assert_ne!(source, target);
    }
    }
    let reintro = std::mem::take(&mut ws.must_reintroduce);
  • replacement in libpijul/src/unrecord/mod.rs at line 399
    [3.1845][3.241314:241349](),[3.241314][3.241314:241349](),[3.241349][3.1846:1931](),[3.1931][3.241604:241619](),[3.241604][3.241604:241619]()
    |txn, channel, a, b| {
    must_reintroduce(txn, channel, changes, a, b, ext, intro, change_id)
    },
    [3.1845]
    [2.30211]
    |a, b| reintro.contains(&(a, b)),
  • edit in libpijul/src/unrecord/mod.rs at line 403
    [3.241637]
    [3.241961]
    ws.must_reintroduce = reintro;
    ws.must_reintroduce.clear();
  • replacement in libpijul/src/apply.rs at line 9
    [3.93417][2.89920:89930]()
    mod edge;
    [3.93417]
    [2.89930]
    pub(crate) mod edge;
  • replacement in libpijul/src/apply.rs at line 248
    [3.950014][3.126004:126099]()
    |_, _, _, _| Ok::<bool, LocalApplyError<T::GraphError>>(true),
    [3.950014]
    [2.90134]
    |_, _| true,
  • replacement in libpijul/src/apply.rs at line 270
    [3.126360][3.126360:126451]()
    |_, _, _, _| Ok::<bool, LocalApplyError<T::GraphError>>(true),
    [3.126360]
    [2.90188]
    |_, _| true,
  • replacement in libpijul/src/apply/edge.rs at line 6
    [2.96273][2.96273:96305]()
    pub fn put_newedge<T, E, F, K>(
    [2.96273]
    [2.96305]
    pub fn put_newedge<T, F, K>(
  • replacement in libpijul/src/apply/edge.rs at line 15
    [2.96505][2.96505:96524]()
    ) -> Result<(), E>
    [2.96505]
    [2.96524]
    ) -> Result<(), LocalApplyError<T::GraphError>>
  • replacement in libpijul/src/apply/edge.rs at line 18
    [2.96551][2.96551:96715]()
    E: From<LocalApplyError<T::GraphError>> + From<TxnErr<T::GraphError>>,
    F: Fn(&mut T, &mut T::Graph, Vertex<ChangeId>, Vertex<ChangeId>) -> Result<bool, E>,
    [2.96551]
    [2.96715]
    F: Fn(Vertex<ChangeId>, Vertex<ChangeId>) -> bool,
  • replacement in libpijul/src/apply/edge.rs at line 40
    [2.97389][2.97389:97440]()
    collect_nondeleted_zombies::<_, E, _>(
    [2.97389]
    [2.97440]
    collect_nondeleted_zombies::<_, _>(
  • replacement in libpijul/src/apply/edge.rs at line 68
    [2.98413][2.98413:98467]()
    if apply_check(txn, graph, source, target)? {
    [2.98413]
    [2.98467]
    if apply_check(source, target) {
  • replacement in libpijul/src/apply/edge.rs at line 94
    [2.99267][2.99267:99307]()
    fn collect_nondeleted_zombies<T, E, K>(
    [2.99267]
    [2.99307]
    fn collect_nondeleted_zombies<T, K>(
  • replacement in libpijul/src/apply/edge.rs at line 101
    [2.99461][2.99461:99480]()
    ) -> Result<(), E>
    [2.99461]
    [2.99480]
    ) -> Result<(), LocalApplyError<T::GraphError>>
  • edit in libpijul/src/apply/edge.rs at line 104
    [2.99507][2.99507:99582]()
    E: From<LocalApplyError<T::GraphError>> + From<TxnErr<T::GraphError>>,
  • replacement in libpijul/src/apply/edge.rs at line 152
    [2.100992][2.100992:101032]()
    fn find_source_vertex<T: GraphMutTxnT>(
    [2.100992]
    [2.101032]
    pub(crate) fn find_source_vertex<T: GraphMutTxnT>(
  • replacement in libpijul/src/apply/edge.rs at line 173
    [2.101745][2.101745:101785]()
    fn find_target_vertex<T: GraphMutTxnT>(
    [2.101745]
    [2.101785]
    pub(crate) fn find_target_vertex<T: GraphMutTxnT>(
  • edit in Cargo.lock at line 950
    [3.1055730]
    [3.1055730]
    "path-slash",
  • edit in Cargo.lock at line 1278
    [3.1063641]
    [3.1063843]
    [[package]]
    name = "path-slash"
    version = "0.1.4"
    source = "registry+https://github.com/rust-lang/crates.io-index"
    checksum = "3cacbb3c4ff353b534a67fb8d7524d00229da4cb1dc8c79f4db96e375ab5b619"
  • edit in Cargo.lock at line 1317
    [10.1067]
    [2.118314]
    "path-slash",