B:BD[
3.5632] → [
3.5632:6281]
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