Refactor archive command's handling of repo and channel
Dependencies
- [2]
3OPNBBAUMigrate from `pijul::remote` to `pijul_remote` - [3]
QQS7LII4Add value hints to arguments - [4]
GKSVBEUWRefactor Repository constructors to take Option<&Path> instead of Option<PathBuf> - [5]
UDHP4ZVBFixing SSH asynchronicity issues - [6]
3X5ZCEPZFixing a panic when `pijul archive` does not find the channel - [7]
WW2EOFBBUmask in archives - [8]
5OGOE4VWStore the current channel in the pristine - [9]
76PCXGMLPushing to, and pulling from the local repository - [10]
ZBNKSYA6Fixing a bus error when starting a transaction on a full disk - [11]
AEPEFS7OWrite help for each argument - [12]
Y2Y4OOIEMove `pijul::DEFAULT_CHANNEL` to `libpijul` - [13]
2RXOCWUWMaking libpijul deterministic (and getting rid of `rand`) - [14]
KWAMD2KRA few fixes in the documentation comments - [15]
A3RM526YIntegrating identity malleability - [16]
L4JXJHWXpijul/*: reorganize imports and remove extern crate - [17]
I52XSRUHMassive cleanup, and simplification - [18]
C4MJ7D7QVerbose printing of conflicts to stderr - [19]
SXEYMYF7Fixing the bad changes in history (unfortunately, by rebooting). - [20]
PIQCNEEBUpgrading to Clap 3.0.0-alpha.5 - [21]
YXAVFTPPAllowing vertex buffer to use references to the transaction, by changing `output::output` to take an ArcTxn<T> instead of a simple T - [22]
MEK57BADOptional user in ssh_remote, allows to fix the key proof in `pijul id ed` - [23]
BY5FVZAVAdd a prefix in `pijul archive` in all cases - [24]
2UTQVDLPDo not create an archive if the prefix is absolute - [25]
CCLLB7OIUpgrading to Sanakirja 0.15 + version bump - [26]
4H2XTVJ2Fix some mistakes in the docs - [27]
JL4WKA5PImplement the Sanakirja concurrency model in a cross-process way - [*]
ABQDWHNGMigrate from `pijul::repository` to `pijul-repository`
Change contents
- edit in pijul/src/commands/archive.rs at line 1
use std::path::PathBuf; - replacement in pijul/src/commands/archive.rs at line 3
use libpijul::{Hash, Merkle, TxnT};use libpijul::{Hash, Merkle}; - edit in pijul/src/commands/archive.rs at line 6[5.191247][29.2089]
use crate::commands::common_opts::RepoAndChannel;use crate::commands::load_channel; - replacement in pijul/src/commands/archive.rs at line 12[5.191291]→[5.3705:3855](∅→∅),[5.3855]→[3.2747:2813](∅→∅),[3.2813]→[5.191324:191356](∅→∅),[5.191324]→[5.191324:191356](∅→∅),[5.191356]→[5.3700:3757](∅→∅),[5.3757]→[5.191356:191415](∅→∅),[5.5537]→[5.191356:191415](∅→∅),[5.191356]→[5.191356:191415](∅→∅)
/// Set the repository where this command should run. Defaults to the first ancestor of the current directory that contains a `.pijul` directory.#[clap(long = "repository", value_hint = ValueHint::DirPath)]repo_path: Option<PathBuf>,/// Use this channel, instead of the current channel#[clap(long = "channel")]channel: Option<String>,#[clap(flatten)]base: RepoAndChannel, - edit in pijul/src/commands/archive.rs at line 70
let mut actual_repo = self.base.repo_path().map(|v| v.to_path_buf()); - replacement in pijul/src/commands/archive.rs at line 79[5.192302]→[5.192302:192413](∅→∅),[5.192413]→[5.1364:1410](∅→∅),[5.1410]→[5.192456:192475](∅→∅),[5.192456]→[5.192456:192475](∅→∅)
if let Some(ref channel) = self.channel {channel} else {libpijul::DEFAULT_CHANNEL},self.base.channel().unwrap_or(libpijul::DEFAULT_CHANNEL), - replacement in pijul/src/commands/archive.rs at line 85
if let Some(ref mut path) = self.repo_path {path.clear();path.push(rem);if self.base.repo_path().is_some() {actual_repo = Some(rem.into()); - replacement in pijul/src/commands/archive.rs at line 100
if let Ok(repo) = Repository::find_root(self.repo_path.as_deref()) {if let Ok(repo) = Repository::find_root(actual_repo.as_deref()) { - edit in pijul/src/commands/archive.rs at line 107
let txn = repo.pristine.arc_txn_begin()?;let (channel, _) = load_channel(self.base.channel(), &*txn.read())?; - edit in pijul/src/commands/archive.rs at line 113[5.193436]→[5.1833:2095](∅→∅),[5.2095]→[5.1411:1494](∅→∅),[5.1494]→[5.2175:2260](∅→∅),[5.2175]→[5.2175:2260](∅→∅),[5.2260]→[5.4586:4605](∅→∅),[5.4586]→[5.4586:4605](∅→∅)
let txn = repo.pristine.arc_txn_begin()?;let channel = {let txn = txn.read();let channel_name = if let Some(ref c) = self.channel {c} else {txn.current_channel().unwrap_or(libpijul::DEFAULT_CHANNEL)};txn.load_channel(&channel_name)?.unwrap()}; - edit in pijul/src/commands/archive.rs at line 122[5.193815]→[5.2292:2554](∅→∅),[5.2554]→[5.1495:1578](∅→∅),[5.1578]→[5.2634:2888](∅→∅),[5.2634]→[5.2634:2888](∅→∅),[5.2888]→[5.4800:4819](∅→∅),[5.4800]→[5.4800:4819](∅→∅)
let txn = repo.pristine.arc_txn_begin()?;let channel = {let txn = txn.read();let channel_name = if let Some(ref c) = self.channel {c} else {txn.current_channel().unwrap_or(libpijul::DEFAULT_CHANNEL)};if let Some(channel) = txn.load_channel(&channel_name)? {channel} else {bail!("No such channel: {:?}", channel_name);}}; - edit in pijul/src/commands/archive.rs at line 124