A more accurate safeguard for apply, to check if the output is nondestructive

pmeunier
Feb 27, 2023, 10:34 PM
26VQKD254I5DSCJY6IBALOI6IV6OAEKSBU67MOLX3EHNRJCMQZ4AC

Dependencies

  • [2] ISZ65SPQ Checking that `pijul apply` does not destroy unrecorded changes
  • [3] 2D7P2VKJ Change completions (where the whole progress bar story started)
  • [4] C4MJ7D7Q Verbose printing of conflicts to stderr
  • [*] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [*] R3H7D42U Debugging `pijul git`: proper error reporting

Change contents

  • edit in pijul/src/commands/apply.rs at line 59
    [6.195413]
    [7.816]
    use libpijul::MutTxnT;
    use rand::Rng;
    // Channel used to check if we can output the repo.
    let forked_s: String = rand::thread_rng()
    .sample_iter(&rand::distributions::Alphanumeric)
    .take(20)
    .map(char::from)
    .collect();
    let forked = txn.write().fork(&channel, &forked_s)?;
  • replacement in pijul/src/commands/apply.rs at line 154
    [2.512][2.512:553]()
    channel.clone(),
    [2.512]
    [2.553]
    forked.clone(),
  • replacement in pijul/src/commands/apply.rs at line 165
    [2.968][2.968:1009]()
    channel.clone(),
    [2.968]
    [2.1009]
    libpijul::Algorithm::default(),
    forked.clone(),
  • edit in pijul/src/commands/apply.rs at line 178
    [2.1421]
    [2.1421]
    debug!("actions {:#?}", rec.actions);
  • edit in pijul/src/commands/apply.rs at line 180
    [2.1512]
    [2.1512]
    } else {
    txn.write().drop_channel(&forked_s)?;
  • edit in pijul/src/commands/apply.rs at line 185
    [2.1545][2.1545:1546]()