Refactor change 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]
5OGOE4VWStore the current channel in the pristine - [6]
EUZFFJSOUpdating Pijul with the latest changes in Libpijul - [7]
VIHXB7SGcommands: set up pager for diff, change, and credit - [8]
ABQDWHNGMigrate from `pijul::repository` to `pijul-repository` - [9]
Q4SVMHAERemoving --channel from the changes command - [10]
X243Z3Y5Recording only the required metadata (can even be changed later!) - [11]
L4JXJHWXpijul/*: reorganize imports and remove extern crate - [12]
JG3MWHENcommands/change: help messages - [13]
I24UEJQLVarious post-fire fixes - [14]
RUBBHYZ7Removing unnecessary async/await - [15]
WIZFLH5SAllow reading changes from .pijul/changes with `pijul change`, even if they are not applied - [16]
PIQCNEEBUpgrading to Clap 3.0.0-alpha.5 - [17]
SXEYMYF7Fixing the bad changes in history (unfortunately, by rebooting). - [18]
A3RM526YIntegrating identity malleability - [19]
A6R6SGCPFixing a panic in `pijul change` - [20]
CCLLB7OIUpgrading to Sanakirja 0.15 + version bump - [21]
2K7JLB4ZNo pager on Windows - [22]
Y6EVFMTADon't output files if they aren't in the current channel
Change contents
- replacement in pijul/src/commands/change.rs at line 1
use std::path::PathBuf;use clap::Parser; - edit in pijul/src/commands/change.rs at line 3
use clap::{Parser, ValueHint}; - edit in pijul/src/commands/change.rs at line 5
- edit in pijul/src/commands/change.rs at line 6
use crate::commands::common_opts::RepoPath;use crate::commands::get_channel; - replacement in pijul/src/commands/change.rs at line 12[5.189514]→[5.0:68](∅→∅),[5.68]→[3.2627:2714](∅→∅),[5.122]→[5.189547:189579](∅→∅),[3.2714]→[5.189547:189579](∅→∅),[5.189547]→[5.189547:189579](∅→∅)
/// Use the repository at PATH instead of the current directory#[clap(long = "repository", value_name = "PATH", value_hint = ValueHint::DirPath)]repo_path: Option<PathBuf>,#[clap(flatten)]base: RepoPath, - replacement in pijul/src/commands/change.rs at line 21
let repo = Repository::find_root(self.repo_path.as_deref())?;let repo = Repository::find_root(self.base.repo_path())?; - replacement in pijul/src/commands/change.rs at line 32[5.190246]→[2.1272:1363](∅→∅),[2.1363]→[5.4307:4391](∅→∅),[5.4307]→[5.4307:4391](∅→∅),[5.4391]→[5.152:197](∅→∅),[5.19123]→[5.152:197](∅→∅),[5.152]→[5.152:197](∅→∅)
let channel_name = txn.current_channel().unwrap_or(libpijul::DEFAULT_CHANNEL);let channel = if let Some(channel) = txn.load_channel(&channel_name)? {channel} else {let (channel_name, _) = get_channel(None, &txn);let Some(channel) = txn.load_channel(channel_name)? else {