Fixing a bug in unrecord

[?]
Jan 7, 2021, 7:07 PM
JACZYXK43IU5HWLHQBY3BOAE7CUO6NGEXQ3HSZL3CQP3SLGKMBOAC

Dependencies

  • [2] CCLLB7OI Upgrading to Sanakirja 0.15 + version bump
  • [3] BD5PC25A Deleting conflict resolution vertices when the sides are deleted
  • [4] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [5] VO5OQW4W Removing anyhow in libpijul
  • [6] 6YMDOZIB Refactoring apply
  • [7] I52XSRUH Massive cleanup, and simplification
  • [*] 76PCXGML Pushing to, and pulling from the local repository

Change contents

  • edit in pijul/src/remote/mod.rs at line 94
    [9.772]
    [3.54644]
    root: Path::new(name).to_path_buf(),
  • replacement in libpijul/src/vertex_buffer.rs at line 79
    [3.219820][3.5737:5817]()
    fn output_line<E, C>(&mut self, _: Vertex<ChangeId>, c: C) -> Result<(), E>
    [3.219820]
    [3.5817]
    fn output_line<E, C>(&mut self, v: Vertex<ChangeId>, c: C) -> Result<(), E>
  • edit in libpijul/src/vertex_buffer.rs at line 86
    [3.220046]
    [3.220046]
    debug!("vbuf {:?} {:?}", v, std::str::from_utf8(&self.buf));
  • replacement in libpijul/src/vertex_buffer.rs at line 168
    [3.222360][3.6212:6292]()
    fn output_line<E, C>(&mut self, _: Vertex<ChangeId>, c: C) -> Result<(), E>
    [3.222360]
    [3.6292]
    fn output_line<E, C>(&mut self, v: Vertex<ChangeId>, c: C) -> Result<(), E>
  • edit in libpijul/src/vertex_buffer.rs at line 175
    [3.222586]
    [3.222586]
    debug!("vbuf {:?} {:?}", v, std::str::from_utf8(&self.buf));
  • replacement in libpijul/src/unrecord/mod.rs at line 522
    [3.247825][3.247825:247885]()
    |h| changes.knows(&intro_ext, &h).unwrap(),
    [3.247825]
    [3.4025]
    |h| changes.knows(&change_hash, &h).unwrap(),
  • edit in libpijul/src/missing_context.rs at line 172
    [2.89764]
    [3.11056]
    debug!("deleted by unknown, repairing {:?}", source);
  • replacement in libpijul/src/missing_context.rs at line 177
    [3.11219][3.11219:11301]()
    reconnect_target_down(txn, channel, ws, inode, target, change_id, &mut known)
    [3.11219]
    [3.11301]
    if e.flag.contains(EdgeFlags::BLOCK) {
    repair_missing_down_context(txn, channel, ws, inode, target, &[target])?;
    } else if is_alive(txn, channel, source)? {
    repair_missing_down_context(txn, channel, ws, inode, target, &[source])?;
    }
    Ok(())
  • edit in libpijul/src/missing_context.rs at line 209
    [3.11910][3.704864:704870](),[3.704864][3.704864:704870](),[3.704870][3.11911:11924](),[3.11924][3.704870:704871](),[3.704870][3.704870:704871](),[3.704871][2.89964:90010](),[2.90010][3.11966:11983](),[3.11966][3.11966:11983](),[3.11983][2.90011:90039](),[2.90039][3.12013:12146](),[3.12013][3.12013:12146](),[3.12146][2.90040:90085](),[2.90085][3.12186:12222](),[3.12186][3.12186:12222](),[3.12222][3.704871:705017](),[3.704871][3.704871:705017](),[3.705017][2.90086:90157](),[3.57956][3.705105:705429](),[2.90157][3.705105:705429](),[3.12273][3.705105:705429](),[3.705105][3.705105:705429](),[3.705429][2.90158:90223](),[2.90223][3.705493:705601](),[3.705493][3.705493:705601]()
    }
    Ok(())
    }
    fn reconnect_target_down<T: GraphMutTxnT, K>(
    txn: &mut T,
    channel: &mut T::Graph,
    ws: &mut Workspace,
    inode: Position<Option<Hash>>,
    target: Vertex<ChangeId>,
    change_id: ChangeId,
    known: &mut K,
    ) -> Result<(), MissingError<T::GraphError>>
    where
    K: FnMut(Hash) -> bool,
    {
    // Finally, we fix the down context of target, i.e. collecting unknown deleted children.
    let mut children_are_deleted_by_unknown = false;
    for v in iter_adj_all(txn, channel, target)? {
    let v = v?;
    if !v.flag.contains(EdgeFlags::DELETED)
    || v.flag.contains(EdgeFlags::PARENT)
    || v.introduced_by == change_id
    || v.dest.change.is_root()
    || v.introduced_by.is_root()
    {
    continue;
    }
    // This unwrap is ok, since `v` is in the channel.
    let intro = txn.get_external(v.introduced_by)?.unwrap();
    if !known(intro) {
    children_are_deleted_by_unknown = true;
    break;
    }
  • edit in libpijul/src/missing_context.rs at line 210
    [3.705607][3.705607:705736]()
    if children_are_deleted_by_unknown {
    repair_missing_down_context(txn, channel, ws, inode, target, &[target])?;
    }
  • replacement in libpijul/src/alive/retrieve.rs at line 59
    [3.986530][3.986530:986574]()
    debug!("child {:?}", dest_vid);
    [3.986530]
    [3.986574]
    trace!("child {:?}", dest_vid);
  • edit in libpijul/src/alive/retrieve.rs at line 77
    [2.134778]
    [2.134778]
    debug!("not alive: {:?}", vertex);
  • edit in libpijul/src/alive/retrieve.rs at line 96
    [3.2210]
    [2.135224]
    debug!("flags for {:?}: {:?}", vertex, flags);