Fork to a *state*
Dependencies
- [2]
PRH6LZFXReturn an error when trying to fork from a missing channel - [3]
Y2Y4OOIEMove `pijul::DEFAULT_CHANNEL` to `libpijul` - [4]
CCLLB7OIUpgrading to Sanakirja 0.15 + version bump - [5]
AEPEFS7OWrite help for each argument - [6]
4H2XTVJ2Fix some mistakes in the docs - [7]
YN63NUZOSanakirja 1.0 - [8]
Y6EVFMTADon't output files if they aren't in the current channel - [9]
SXEYMYF7Fixing the bad changes in history (unfortunately, by rebooting). - [10]
I52XSRUHMassive cleanup, and simplification - [11]
PIQCNEEBUpgrading to Clap 3.0.0-alpha.5 - [12]
5OGOE4VWStore the current channel in the pristine - [13]
L4JXJHWXpijul/*: reorganize imports and remove extern crate - [14]
I7VL7VPZMinor cleanup - [15]
EUZFFJSOUpdating Pijul with the latest changes in Libpijul - [16]
KWAMD2KRA few fixes in the documentation comments
Change contents
- replacement in pijul/src/commands/fork.rs at line 4
use libpijul::{MutTxnT, MutTxnTExt, TxnT};use libpijul::{Base32, ChannelTxnT, MutTxnT, MutTxnTExt, TxnT, TxnTExt}; - edit in pijul/src/commands/fork.rs at line 14
/// Make the new channel from this state instead of the current channel#[clap(long = "state", conflicts_with = "change", conflicts_with = "channel")]state: Option<String>, - replacement in pijul/src/commands/fork.rs at line 18
#[clap(long = "channel", conflicts_with = "change")]#[clap(long = "channel", conflicts_with = "change", conflicts_with = "state")] - replacement in pijul/src/commands/fork.rs at line 21
#[clap(long = "change", conflicts_with = "channel")]#[clap(long = "change", conflicts_with = "channel", conflicts_with = "state")] - replacement in pijul/src/commands/fork.rs at line 38[4.168764]→[4.15692:15753](∅→∅),[4.15753]→[3.860:914](∅→∅),[3.914]→[4.15804:15834](∅→∅),[4.15804]→[4.15804:15834](∅→∅),[4.15834]→[4.2740:2825](∅→∅),[4.168764]→[4.2740:2825](∅→∅)
let cur = txn.current_channel().unwrap_or(libpijul::DEFAULT_CHANNEL).to_string();let channel_name = if let Some(ref c) = self.channel {clet mut fork = if let Some(ref channel_name) = self.channel {if let Some(channel) = txn.load_channel(channel_name)? {txn.fork(&channel, &self.to)?} else {anyhow::bail!("Channel not found: {:?}", channel_name);} - replacement in pijul/src/commands/fork.rs at line 45
cur.as_str()let cur = txn.current_channel().unwrap_or(libpijul::DEFAULT_CHANNEL).to_string();if let Some(channel) = txn.load_channel(&cur)? {txn.fork(&channel, &self.to)?} else {anyhow::bail!("Channel not found: {:?}", cur);} - replacement in pijul/src/commands/fork.rs at line 55[4.15879]→[4.2958:3028](∅→∅),[4.2958]→[4.2958:3028](∅→∅),[4.3028]→[4.168919:168966](∅→∅),[4.17354]→[4.168919:168966](∅→∅),[4.168919]→[4.168919:168966](∅→∅),[4.168966]→[2.0:93](∅→∅)
if let Some(channel) = txn.load_channel(&channel_name)? {txn.fork(&channel, &self.to)?;} else {anyhow::bail!("Channel not found: {:?}", channel_name);if let Some(ref state) = self.state {if let Some(state) = libpijul::Merkle::from_base32(state.as_bytes()) {let ch = fork.write();if let Some(n) = txn.channel_has_state(&ch.states, &state.into())? {let n: u64 = n.into();let mut v = Vec::new();for l in txn.reverse_log(&ch, None)? {let (n_, h) = l?;if n_ > n {v.push(h.0.into())} else {break;}}std::mem::drop(ch);for h in v {txn.unrecord(&repo.changes, &mut fork, &h, 0)?;}}}