Refactor debug command's handling of repo and channel
Dependencies
- [2]
MQ6ERQ43Bug fixes when unrecording a patch that introduced zombie files - [3]
Y2Y4OOIEMove `pijul::DEFAULT_CHANNEL` to `libpijul` - [4]
QQS7LII4Add value hints to arguments - [5]
GKSVBEUWRefactor Repository constructors to take Option<&Path> instead of Option<PathBuf> - [6]
CCLLB7OIUpgrading to Sanakirja 0.15 + version bump - [7]
L4JXJHWXpijul/*: reorganize imports and remove extern crate - [8]
SXEYMYF7Fixing the bad changes in history (unfortunately, by rebooting). - [9]
JL4WKA5PImplement the Sanakirja concurrency model in a cross-process way - [10]
I24UEJQLVarious post-fire fixes - [11]
5OGOE4VWStore the current channel in the pristine - [12]
5BRU2RRWCleanup (debugging a crash related to trees/inodes) - [13]
AEPEFS7OWrite help for each argument - [14]
HMMMKONLFixing alive vertices - [15]
I7VL7VPZMinor cleanup - [16]
A3RM526YIntegrating identity malleability - [17]
74HX2XZDCleanup and debugging - [18]
4H2XTVJ2Fix some mistakes in the docs - [19]
RUBBHYZ7Removing unnecessary async/await - [20]
PIQCNEEBUpgrading to Clap 3.0.0-alpha.5 - [21]
I52XSRUHMassive cleanup, and simplification - [22]
BD5PC25ADeleting conflict resolution vertices when the sides are deleted - [23]
X243Z3Y5Recording only the required metadata (can even be changed later!) - [24]
Y6EVFMTADon't output files if they aren't in the current channel - [25]
ABQDWHNGMigrate from `pijul::repository` to `pijul-repository`
Change contents
- replacement in pijul/src/commands/debug.rs at line 1[6.177758]→[6.2712:2737](∅→∅),[6.177794]→[6.17710:17728](∅→∅),[6.17728]→[4.2079:2110](∅→∅),[6.1386]→[6.0:31](∅→∅),[4.2110]→[6.0:31](∅→∅),[6.16]→[6.0:31](∅→∅)
use std::path::PathBuf;use anyhow::bail;use clap::{Parser, ValueHint};use libpijul::{TxnT, TxnTExt};use crate::commands::common_opts::RepoAndChannel;use crate::commands::load_channel;use clap::Parser;use libpijul::TxnTExt; - replacement in pijul/src/commands/debug.rs at line 10[6.177879]→[4.2111:2177](∅→∅),[4.2177]→[6.177912:177944](∅→∅),[6.177912]→[6.177912:177944](∅→∅),[6.4302]→[6.177944:178003](∅→∅),[6.177944]→[6.177944:178003](∅→∅)
#[clap(long = "repository", value_hint = ValueHint::DirPath)]repo_path: Option<PathBuf>,#[clap(long = "channel")]channel: Option<String>,#[clap(flatten)]base: RepoAndChannel, - replacement in pijul/src/commands/debug.rs at line 19
let repo = Repository::find_root(self.repo_path.as_deref())?;let repo = Repository::find_root(self.base.repo_path())?; - replacement in pijul/src/commands/debug.rs at line 21[6.178176]→[6.3312:3406](∅→∅),[6.3406]→[3.1054:1125](∅→∅),[3.1125]→[6.3474:3506](∅→∅),[6.3474]→[6.3474:3506](∅→∅),[6.977]→[6.17729:17809](∅→∅),[6.2540]→[6.17729:17809](∅→∅),[6.3506]→[6.17729:17809](∅→∅),[6.178297]→[6.17729:17809](∅→∅),[6.17809]→[6.178376:178413](∅→∅),[6.178376]→[6.178376:178413](∅→∅),[6.178413]→[6.17810:17867](∅→∅),[6.17867]→[6.178548:178559](∅→∅),[6.178548]→[6.178548:178559](∅→∅)
let channel_name = if let Some(ref c) = self.channel {c} else {txn.current_channel().unwrap_or(libpijul::DEFAULT_CHANNEL)}.to_string();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)?;