Tag CLI cleanup
Dependencies
- [2]
5OGOE4VWStore the current channel in the pristine - [3]
SMMBFECLConverting to the new patch format "online" - [4]
AAXP2534Tags: completing the subcommand - [5]
EEBKW7VTKeys and identities - [6]
A3RM526YIntegrating identity malleability - [7]
QL6K2ZM3Tags
Change contents
- edit in pijul/src/commands/tag.rs at line 11
use log::*; - replacement in pijul/src/commands/tag.rs at line 62
let mut txn = repo.pristine.mut_txn_begin()?;let channel_name = if let Some(ref c) = channel {let txn = repo.pristine.mut_txn_begin()?;let channel_name = if let Some(c) = channel { - replacement in pijul/src/commands/tag.rs at line 66
txn.current_channel().unwrap_or(crate::DEFAULT_CHANNEL)txn.current_channel().unwrap_or(crate::DEFAULT_CHANNEL).to_string() - replacement in pijul/src/commands/tag.rs at line 70
try_record(&mut repo, &channel_name)?;debug!("channel_name = {:?}", channel_name);let txn = Arc::new(RwLock::new(txn));try_record(&mut repo, txn.clone(), &channel_name)?;let mut txn = if let Ok(txn) = Arc::try_unwrap(txn) {txn.into_inner().unwrap()} else {unreachable!()}; - replacement in pijul/src/commands/tag.rs at line 200
fn try_record(repo: &mut Repository, channel: &str) -> Result<(), anyhow::Error> {let txn = repo.pristine.mut_txn_begin()?;if let Some(channel) = txn.load_channel(channel)? {let mut state = libpijul::RecordBuilder::new();state.record(Arc::new(RwLock::new(txn)),libpijul::Algorithm::default(),channel,repo.working_copy.clone(),&repo.changes,"",num_cpus::get(),)?;let rec = state.finish();if !rec.actions.is_empty() {bail!("Cannot change channel, as there are unrecorded changes.")}fn try_record<T: ChannelMutTxnT + TxnT + Send + Sync + 'static>(repo: &mut Repository,txn: Arc<RwLock<T>>,channel: &str,) -> Result<(), anyhow::Error> {let channel = if let Some(channel) = txn.read().unwrap().load_channel(channel)? {channel - edit in pijul/src/commands/tag.rs at line 209
};let mut state = libpijul::RecordBuilder::new();state.record(txn,libpijul::Algorithm::default(),channel,repo.working_copy.clone(),&repo.changes,"",num_cpus::get(),)?;let rec = state.finish();if !rec.actions.is_empty() {bail!("Cannot change channel, as there are unrecorded changes.") - replacement in libpijul/src/tag.rs at line 106
debug!("restoring graph");let mut vi = Vec::new();for i in ::sanakirja::btree::iter(&filetxn, &external, None).unwrap() {debug!("{:?}", i);vi.push(i.unwrap());}vi.sort();debug!("restoring graph {:?}", vi);