Refactor credit command's handling of repo and channel
Dependencies
- [2]
Y2Y4OOIEMove `pijul::DEFAULT_CHANNEL` to `libpijul` - [3]
QQS7LII4Add value hints to arguments - [4]
GKSVBEUWRefactor Repository constructors to take Option<&Path> instead of Option<PathBuf> - [5]
RUBBHYZ7Removing unnecessary async/await - [6]
YXAVFTPPAllowing vertex buffer to use references to the transaction, by changing `output::output` to take an ArcTxn<T> instead of a simple T - [7]
AEPEFS7OWrite help for each argument - [8]
L4JXJHWXpijul/*: reorganize imports and remove extern crate - [9]
Y6EVFMTADon't output files if they aren't in the current channel - [10]
PIQCNEEBUpgrading to Clap 3.0.0-alpha.5 - [11]
SXEYMYF7Fixing the bad changes in history (unfortunately, by rebooting). - [12]
YN63NUZOSanakirja 1.0 - [13]
A3RM526YIntegrating identity malleability - [14]
4H2XTVJ2Fix some mistakes in the docs - [15]
I7VL7VPZMinor cleanup - [16]
5OGOE4VWStore the current channel in the pristine - [17]
Y7YAFMFFFix path prefix striping on Windows. - [18]
CCLLB7OIUpgrading to Sanakirja 0.15 + version bump - [19]
KWAMD2KRA few fixes in the documentation comments - [20]
JL4WKA5PImplement the Sanakirja concurrency model in a cross-process way - [*]
ABQDWHNGMigrate from `pijul::repository` to `pijul-repository`
Change contents
- edit in pijul/src/commands/credit.rs at line 4
use anyhow::bail; - edit in pijul/src/commands/credit.rs at line 11[5.178930][22.1967]
use crate::commands::common_opts::RepoAndChannel;use crate::commands::load_channel; - replacement in pijul/src/commands/credit.rs at line 17[5.178973]→[5.3260:3410](∅→∅),[5.3410]→[3.2210:2276](∅→∅),[3.2276]→[5.179006:179038](∅→∅),[5.179006]→[5.179006:179038](∅→∅),[5.179038]→[5.4453:4509](∅→∅),[5.4509]→[5.179038:179097](∅→∅),[5.179038]→[5.179038:179097](∅→∅)
/// 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, - replacement in pijul/src/commands/credit.rs at line 26[5.2305]→[5.179185:179239](∅→∅),[5.15721]→[5.179185:179239](∅→∅),[5.179185]→[5.179185:179239](∅→∅),[5.179239]→[4.2467:2537](∅→∅)
let has_repo_path = self.repo_path.is_some();let repo = Repository::find_root(self.repo_path.as_deref())?;let has_repo_path = self.base.repo_path().is_some();let repo = Repository::find_root(self.base.repo_path())?; - replacement in pijul/src/commands/credit.rs at line 30[5.1081]→[5.3573:3667](∅→∅),[5.179348]→[5.3573:3667](∅→∅),[5.3667]→[2.1126:1197](∅→∅),[2.1197]→[5.3735:3746](∅→∅),[5.3735]→[5.3735:3746](∅→∅),[5.1063]→[5.18121:18201](∅→∅),[5.2631]→[5.18121:18201](∅→∅),[5.3746]→[5.18121:18201](∅→∅),[5.179431]→[5.18121:18201](∅→∅),[5.18201]→[5.179510:179547](∅→∅),[5.179510]→[5.179510:179547](∅→∅),[5.179547]→[5.18202:18259](∅→∅),[5.18259]→[5.179682:179693](∅→∅),[5.179682]→[5.179682:179693](∅→∅)
let channel_name = if let Some(ref c) = self.channel {c} else {txn.current_channel().unwrap_or(libpijul::DEFAULT_CHANNEL)};let channel = if let Some(channel) = txn.load_channel(&channel_name)? {channel} else {bail!("No such channel: {:?}", channel_name)};let (channel, _) = load_channel(self.base.channel(), &*txn)?;