Use memory working copy if not pulling to current channel

dblsaiko
Apr 1, 2024, 12:27 AM
2LUGQKW5Q2JQHS5HTQBAYBJC3JDRGW7SUDR4GJDCGYXVGRPCEVVAC

Dependencies

  • [2] EUZFFJSO Updating Pijul with the latest changes in Libpijul
  • [3] YN63NUZO Sanakirja 1.0
  • [4] L4JXJHWX pijul/*: reorganize imports and remove extern crate
  • [5] PIQCNEEB Upgrading to Clap 3.0.0-alpha.5
  • [6] 4RV7T4SR Migrate from `pijul::config` to `pijul-config`
  • [7] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [8] 5DVRL6MF Hard-unrecord
  • [9] CCLLB7OI Upgrading to Sanakirja 0.15 + version bump
  • [10] I24UEJQL Various post-fire fixes
  • [11] GYGLQPVX Migrate from `pijul::current_dir` to `std::env::current_dir`

Change contents

  • replacement in pijul-repository/src/lib.rs at line 7
    [3.7684][3.0:23](),[3.21541][3.0:23]()
    use libpijul::DOT_DIR;
    [3.7684]
    [3.23]
    use libpijul::pristine::sanakirja::SanakirjaError;
    use libpijul::{working_copy, TxnT, DOT_DIR};
  • edit in pijul-repository/src/lib.rs at line 158
    [3.25352]
    [3.25352]
    }
    pub fn working_copy(&self, channel: &str) -> Result<working_copy::Any, SanakirjaError> {
    let txn = self.pristine.txn_begin()?;
    let cc = txn.current_channel()?;
    let wc = if cc == channel {
    working_copy::Any::FileSystem(self.working_copy.clone())
    } else {
    working_copy::Any::Memory(working_copy::Memory::new())
    };
    Ok(wc)
  • edit in pijul/src/commands/mod.rs at line 82
    [3.1944]
    [3.18772]
    let wc = repo.working_copy(txn.read().name(&channel.read()))?;
  • replacement in pijul/src/commands/mod.rs at line 92
    [3.18896][2.12780:12808]()
    &repo.working_copy,
    [3.18896]
    [3.2068]
    &wc,