Fixing a bug in deletions (the encoding was improperly set)

pmeunier
Jun 28, 2021, 3:57 PM
SBSM3VZVFD2A5MD5P3XEUH4LFONYABZCKRNAGIHGTSZOG2QS5SYAC

Dependencies

  • [2] I24UEJQL Various post-fire fixes
  • [3] ZSF3YFZT encoded file deletion
  • [4] I52XSRUH Massive cleanup, and simplification
  • [5] YN63NUZO Sanakirja 1.0
  • [6] ZXTHL45O address clippy lints
  • [7] WZVCLZKY address clippy lints
  • [8] TVVW53HZ Conflict resolution
  • [9] O4DNWMPD Cleaunp and proofreading of libpijul::record
  • [10] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [11] CCLLB7OI Upgrading to Sanakirja 0.15 + version bump
  • [12] IIV3EL2X Cleanup, formatting, and fixing the Git feature
  • [13] ZAEUSICJ File deletions were not shown with their names in the metadata during record

Change contents

  • replacement in libpijul/src/record.rs at line 524
    [2.52540][2.52540:52874]()
    if name.len() > 2 {
    if let Ok(name) = std::str::from_utf8(&name[2..]) {
    if !full_path.is_empty() {
    full_path.push('/');
    }
    full_path.push_str(name);
    }
    [2.52540]
    [2.52874]
    let meta = FileMetadata::read(&name);
    if !full_path.is_empty() {
    full_path.push('/');
  • edit in libpijul/src/record.rs at line 528
    [2.52896]
    [2.52896]
    full_path.push_str(meta.basename);
  • edit in libpijul/src/record.rs at line 1232
    [4.519117][3.3039:3454]()
    let name_dest = txn.find_block_end(channel, current_vertex).unwrap();
    let mut meta = Vec::new();
    let FileMetadata { encoding, .. } = changes
    .get_file_meta(
    |p| txn.get_external(&p).unwrap().map(From::from),
    *name_dest,
    &mut meta,
    )
    .map_err(RecordError::Changestore)?;
  • replacement in libpijul/src/record.rs at line 1256
    [4.520253][3.3455:3497]()
    self.delete_inode_vertex(
    [4.520253]
    [3.3497]
    self.delete_inode_vertex::<_, _, W>(
    changes,
  • edit in libpijul/src/record.rs at line 1263
    [3.3650][3.3650:3680]()
    encoding,
  • replacement in libpijul/src/record.rs at line 1296
    [4.521266][4.37854:37896]()
    fn delete_inode_vertex<T: GraphTxnT>(
    [4.521266]
    [4.521303]
    fn delete_inode_vertex<T: GraphTxnT, C: ChangeStore, W: WorkingCopy>(
  • edit in libpijul/src/record.rs at line 1298
    [4.521322]
    [4.521322]
    changes: &C,
  • replacement in libpijul/src/record.rs at line 1304
    [4.521458][3.3700:3736](),[3.3736][4.37926:37971](),[4.521458][4.37926:37971]()
    encoding: Option<Encoding>,
    ) -> Result<(), TxnErr<T::GraphError>> {
    [4.521458]
    [4.959]
    ) -> Result<(), RecordError<C::Error, W::Error, T::GraphError>>
    where
    <W as WorkingCopy>::Error: 'static,
    {
  • edit in libpijul/src/record.rs at line 1310
    [4.521502]
    [4.35508]
    let mut enc = None;
    let mut previous_name = Vec::new();
  • edit in libpijul/src/record.rs at line 1325
    [4.54632]
    [4.35967]
    if enc.is_none() {
    let FileMetadata { encoding, .. } = changes
    .get_file_meta(
    |p| txn.get_external(&p).unwrap().map(From::from),
    *parent_dest,
    &mut previous_name,
    )
    .map_err(RecordError::Changestore)?;
    enc = Some(encoding);
    }
  • replacement in libpijul/src/record.rs at line 1378
    [4.523709][3.3737:3763]()
    encoding,
    [4.523709]
    [4.523709]
    encoding: enc.unwrap(),