Make recursive directory removal optional

pmeunier
Jul 21, 2021, 12:32 PM
EAAJNZ3J57QH5P5UWJD5CRN62HZKCRW5BKLUCIHSFFKXLUVEFH2AC

Dependencies

  • [2] GJZWSXHQ Do not remove files not tracked in the new channel when outputting
  • [3] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [4] TVVW53HZ Conflict resolution
  • [5] FXEDPLRI Resurrecting tests, and type cleanup (no need for Arc<RwLock<…>> anymore)
  • [6] YN63NUZO Sanakirja 1.0
  • [7] VO5OQW4W Removing anyhow in libpijul
  • [8] 5BRU2RRW Cleanup (debugging a crash related to trees/inodes)
  • [9] CCLLB7OI Upgrading to Sanakirja 0.15 + version bump
  • [10] U4F5G3AU Do not delete unknown files during a reset
  • [11] GJOE3RZ6 Converting a benign error message into an info
  • [12] JP3BYVXX Fixing file paths on Windows
  • [13] I24UEJQL Various post-fire fixes

Change contents

  • replacement in libpijul/src/working_copy/mod.rs at line 20
    [3.1728][3.24701:24767]()
    fn remove_path(&self, name: &str) -> Result<(), Self::Error>;
    [3.1728]
    [3.24767]
    fn remove_path(&self, name: &str, rec: bool) -> Result<(), Self::Error>;
  • replacement in libpijul/src/working_copy/memory.rs at line 266
    [3.207007][3.26328:26395]()
    fn remove_path(&self, path: &str) -> Result<(), Self::Error> {
    [3.207007]
    [3.424]
    fn remove_path(&self, path: &str, _rec: bool) -> Result<(), Self::Error> {
  • replacement in libpijul/src/working_copy/filesystem.rs at line 337
    [3.214848][3.28859:28926]()
    fn remove_path(&self, path: &str) -> Result<(), Self::Error> {
    [3.214848]
    [3.28926]
    fn remove_path(&self, path: &str, rec: bool) -> Result<(), Self::Error> {
  • replacement in libpijul/src/working_copy/filesystem.rs at line 342
    [3.215062][3.215062:215109]()
    std::fs::remove_dir_all(&path)
    [3.215062]
    [3.215109]
    if rec {
    std::fs::remove_dir_all(&path)
    } else {
    std::fs::remove_dir(&path)
    }
  • replacement in libpijul/src/output/output.rs at line 545
    [3.22808][2.166:283]()
    fn kill_dead_files<T: ChannelTxnT<GraphError = T::TreeError> + TreeMutTxnT, W: WorkingCopy + Clone, C: ChangeStore>(
    [3.22808]
    [3.685451]
    fn kill_dead_files<
    T: ChannelTxnT<GraphError = T::TreeError> + TreeMutTxnT,
    W: WorkingCopy + Clone,
    C: ChangeStore,
    >(
  • replacement in libpijul/src/output/output.rs at line 554
    [3.685544][2.314:379]()
    ) -> Result<(), OutputError<C::Error, T::TreeError, W::Error>>
    {
    [3.685544]
    [2.379]
    ) -> Result<(), OutputError<C::Error, T::TreeError, W::Error>> {
  • replacement in libpijul/src/output/output.rs at line 563
    [3.122018][2.414:553]()
    if txn.get_graph(txn.graph(&*channel), &vertex.inode_vertex(), None).map_err(|x| OutputError::Pristine(x.into()))?.is_some() {
    [3.122018]
    [2.553]
    if txn
    .get_graph(txn.graph(&*channel), &vertex.inode_vertex(), None)
    .map_err(|x| OutputError::Pristine(x.into()))?
    .is_some()
    {
  • replacement in libpijul/src/output/output.rs at line 569
    [2.596][2.596:675]()
    repo.remove_path(&name).map_err(OutputError::WorkingCopy)?
    [2.596]
    [2.675]
    repo.remove_path(&name, false)
    .map_err(OutputError::WorkingCopy)?