Refactor unrecord 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]
LGEJSLTYFixing output (including its uses in reset and pull) - [6]
4H2XTVJ2Fix some mistakes in the docs - [7]
YAJAXIV5Unrecording changes atomically - [8]
5OGOE4VWStore the current channel in the pristine - [9]
EUZFFJSOUpdating Pijul with the latest changes in Libpijul - [10]
SLJ3OHD4unrecord: show list of changes if none were given as arguments - [11]
L4JXJHWXpijul/*: reorganize imports and remove extern crate - [12]
PIQCNEEBUpgrading to Clap 3.0.0-alpha.5 - [13]
3KRGVQFUDo not update the mtime of unmodified files - [14]
5DVRL6MFHard-unrecord - [15]
DO2Y5TY5Tag synchronisation - [16]
O2U2JAFVSolve ordering conflicts - [17]
SXEYMYF7Fixing the bad changes in history (unfortunately, by rebooting). - [18]
I24UEJQLVarious post-fire fixes - [19]
RUBBHYZ7Removing unnecessary async/await - [20]
Y2Y4OOIEMove `pijul::DEFAULT_CHANNEL` to `libpijul` - [21]
KWAMD2KRA few fixes in the documentation comments - [22]
AEPEFS7OWrite help for each argument - [23]
A3RM526YIntegrating identity malleability
Change contents
- replacement in pijul/src/commands/unrecord.rs at line 1[5.514]→[5.95761:95785](∅→∅),[5.95761]→[5.95761:95785](∅→∅),[5.1959]→[5.1143:1144](∅→∅),[5.95785]→[5.1143:1144](∅→∅),[5.1144]→[5.823:871](∅→∅)
use std::path::PathBuf;use super::{make_changelist, parse_changelist};use super::{load_channel, make_changelist, parse_changelist}; - edit in pijul/src/commands/unrecord.rs at line 4
use crate::commands::common_opts::RepoPath; - replacement in pijul/src/commands/unrecord.rs at line 6
use clap::{Parser, ValueHint};use clap::Parser; - replacement in pijul/src/commands/unrecord.rs at line 14[5.95831]→[5.151:301](∅→∅),[5.301]→[3.32:98](∅→∅),[3.98]→[5.95864:95896](∅→∅),[5.95864]→[5.95864:95896](∅→∅)
/// 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>,#[clap(flatten)]base: RepoPath, - replacement in pijul/src/commands/unrecord.rs at line 33
let mut repo = Repository::find_root(self.repo_path.as_deref())?;let mut repo = Repository::find_root(self.base.repo_path())?; - replacement in pijul/src/commands/unrecord.rs at line 36[5.1576]→[5.1576:1649](∅→∅),[5.1649]→[5.88:138](∅→∅),[5.138]→[5.1696:1722](∅→∅),[5.1696]→[5.1696:1722](∅→∅),[5.1722]→[5.75:169](∅→∅),[5.75]→[5.75:169](∅→∅),[5.169]→[5.1723:1748](∅→∅),[5.1748]→[5.185:250](∅→∅),[5.185]→[5.185:250](∅→∅),[5.250]→[5.1749:1836](∅→∅),[5.330]→[5.2089:2195](∅→∅),[5.1836]→[5.2089:2195](∅→∅),[5.2089]→[5.2089:2195](∅→∅)
let cur = txn.read().current_channel().unwrap_or(libpijul::DEFAULT_CHANNEL).to_string();let channel_name = if let Some(ref c) = self.channel {c} else {cur.as_str()};let is_current_channel = cur == channel_name;let channel = if let Some(channel) = txn.read().load_channel(&channel_name)? {channel} else {bail!("No such channel: {:?}", channel_name);};let (channel, is_current_channel) = load_channel(self.channel.as_deref(), &*txn.read())?;