reset: Require --force to reset unspecified unrecorded changes
Dependencies
- [2]
OY3CGEHQEarly stop in the diff algorithms for diff --short - [3]
SXEYMYF7Fixing the bad changes in history (unfortunately, by rebooting). - [4]
QYY37T6YFixing a panic with reset --dry-run and no input - [5]
EUZFFJSOUpdating Pijul with the latest changes in Libpijul - [6]
5OGOE4VWStore the current channel in the pristine - [7]
PIQCNEEBUpgrading to Clap 3.0.0-alpha.5 - [8]
QMTANHVNReset: only output changed files - [9]
I52XSRUHMassive cleanup, and simplification - [10]
VNBLGT6GDo not output unmodified files when resetting (fix) - [11]
Y7YAFMFFFix path prefix striping on Windows. - [12]
QV66H4YAPrevent --channel from being used with a single file in `pijul reset` - [13]
I24UEJQLVarious post-fire fixes - [14]
L4JXJHWXpijul/*: reorganize imports and remove extern crate
Change contents
- replacement in pijul/src/commands/reset.rs at line 7
use libpijul::pristine::{ChangeId, ChannelMutTxnT, Position};use libpijul::{ChannelTxnT, DepsTxnT, MutTxnT, TxnT, TxnTExt};use libpijul::pristine::{sanakirja::MutTxn, ChangeId, ChannelMutTxnT, Position};use libpijul::{ArcTxn, ChannelRef, ChannelTxnT, DepsTxnT, MutTxnT, TxnT, TxnTExt}; - replacement in pijul/src/commands/reset.rs at line 112[3.7517]→[3.7517:7696](∅→∅),[3.7696]→[2.16:43](∅→∅),[2.43]→[3.330:380](∅→∅),[3.7696]→[3.330:380](∅→∅),[3.380]→[3.7696:7733](∅→∅),[3.7696]→[3.7696:7733](∅→∅),[3.7733]→[3.3955:3995](∅→∅),[3.3995]→[3.7780:8038](∅→∅),[3.7780]→[3.7780:8038](∅→∅)
let mut state = libpijul::RecordBuilder::new();state.record(txn.clone(),libpijul::Algorithm::default(),false,&libpijul::DEFAULT_SEPARATOR,channel.clone(),&repo.working_copy,&repo.changes,"",num_cpus::get(),)?;let rec = state.finish();debug!("actions = {:?}", rec.actions);if !rec.actions.is_empty() {if has_unrecorded_changes(txn.clone(), channel.clone(), &repo).unwrap() { - edit in pijul/src/commands/reset.rs at line 123
if !self.force && has_unrecorded_changes(txn.clone(), channel.clone(), &repo).unwrap() {bail!("Refusing to reset, as there are unrecorded changes. Use --force")} - edit in pijul/src/commands/reset.rs at line 283[3.101746]
fn has_unrecorded_changes(txn: ArcTxn<MutTxn<()>>,channel: ChannelRef<MutTxn<()>>,repo: &Repository) -> Result<bool, anyhow::Error> {let mut state = libpijul::RecordBuilder::new();state.record(txn,libpijul::Algorithm::default(),false,&libpijul::DEFAULT_SEPARATOR,channel,&repo.working_copy,&repo.changes,"",num_cpus::get(),)?;let rec = state.finish();debug!("actions = {:?}", rec.actions);Ok(!rec.actions.is_empty())}