Refactor diff 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]
ZHABNS3SCanonicalize all paths - [6]
I52XSRUHMassive cleanup, and simplification - [7]
SXEYMYF7Fixing the bad changes in history (unfortunately, by rebooting). - [8]
PIQCNEEBUpgrading to Clap 3.0.0-alpha.5 - [9]
A3RM526YIntegrating identity malleability - [10]
5OGOE4VWStore the current channel in the pristine - [11]
KWAMD2KRA few fixes in the documentation comments - [12]
I24UEJQLVarious post-fire fixes - [13]
EUZFFJSOUpdating Pijul with the latest changes in Libpijul - [14]
ZBNKSYA6Fixing a bus error when starting a transaction on a full disk - [15]
J33DKFPMDo not traverse unindexed directories in `pijul diff -su` - [16]
HSEYMLO2Adding an untracked change iterator - [17]
L4JXJHWXpijul/*: reorganize imports and remove extern crate - [18]
RUBBHYZ7Removing unnecessary async/await - [19]
V6J6DTJCDo not compute the entire diff if all we want is --json --untracked - [*]
ABQDWHNGMigrate from `pijul::repository` to `pijul-repository` - [*]
ZRUPLBBTColours in diff and change: separating concerns and dependencies
Change contents
- replacement in pijul/src/commands/diff.rs at line 6
use clap::{Parser, ValueHint};use clap::Parser; - replacement in pijul/src/commands/diff.rs at line 8
use libpijul::{MutTxnT, TxnT, TxnTExt};use libpijul::{MutTxnT, TxnTExt}; - edit in pijul/src/commands/diff.rs at line 11
use crate::commands::common_opts::RepoPath; - replacement in pijul/src/commands/diff.rs at line 17[5.173780]→[5.2715:2865](∅→∅),[5.2865]→[3.1892:1958](∅→∅),[3.1958]→[5.173813:173849](∅→∅),[5.173813]→[5.173813:173849](∅→∅)
/// 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)]pub repo_path: Option<PathBuf>,#[clap(flatten)]pub base: RepoPath, - replacement in pijul/src/commands/diff.rs at line 22
/// Compare with this channel./// Compare with CHANNEL instead of the current channel - replacement in pijul/src/commands/diff.rs at line 43
let repo = Repository::find_root(self.repo_path.as_deref())?;let repo = Repository::find_root(self.base.repo_path())?; - replacement in pijul/src/commands/diff.rs at line 56
let cur = txn.read().current_channel().unwrap_or(libpijul::DEFAULT_CHANNEL)let channel = get_channel(self.channel.as_deref(), &*txn.read()).0 - edit in pijul/src/commands/diff.rs at line 59
let channel = if let Some(ref c) = self.channel {c} else {cur.as_str()}; - edit in pijul/src/commands/diff.rs at line 302[22.776][22.776]
use crate::commands::get_channel;