Refactor change command's handling of repo and channel

dblsaiko
Mar 29, 2024, 9:19 PM
U45JUYYGEUYEIF7WNERHP4DUSQ5FUKZIJYF57YH4MPBISNOGC6PAC

Dependencies

  • [2] Y2Y4OOIE Move `pijul::DEFAULT_CHANNEL` to `libpijul`
  • [3] QQS7LII4 Add value hints to arguments
  • [4] GKSVBEUW Refactor Repository constructors to take Option<&Path> instead of Option<PathBuf>
  • [5] 5OGOE4VW Store the current channel in the pristine
  • [6] EUZFFJSO Updating Pijul with the latest changes in Libpijul
  • [7] VIHXB7SG commands: set up pager for diff, change, and credit
  • [8] ABQDWHNG Migrate from `pijul::repository` to `pijul-repository`
  • [9] Q4SVMHAE Removing --channel from the changes command
  • [10] X243Z3Y5 Recording only the required metadata (can even be changed later!)
  • [11] L4JXJHWX pijul/*: reorganize imports and remove extern crate
  • [12] JG3MWHEN commands/change: help messages
  • [13] I24UEJQL Various post-fire fixes
  • [14] RUBBHYZ7 Removing unnecessary async/await
  • [15] WIZFLH5S Allow reading changes from .pijul/changes with `pijul change`, even if they are not applied
  • [16] PIQCNEEB Upgrading to Clap 3.0.0-alpha.5
  • [17] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [18] A3RM526Y Integrating identity malleability
  • [19] A6R6SGCP Fixing a panic in `pijul change`
  • [20] CCLLB7OI Upgrading to Sanakirja 0.15 + version bump
  • [21] 2K7JLB4Z No pager on Windows
  • [22] Y6EVFMTA Don't output files if they aren't in the current channel

Change contents

  • replacement in pijul/src/commands/change.rs at line 1
    [5.189306][5.3082:3106]()
    use std::path::PathBuf;
    [5.189306]
    [5.3106]
    use clap::Parser;
  • edit in pijul/src/commands/change.rs at line 3
    [5.3107][3.2595:2626]()
    use clap::{Parser, ValueHint};
  • edit in pijul/src/commands/change.rs at line 5
    [5.197][5.3124:3125](),[5.189446][5.3124:3125]()
  • edit in pijul/src/commands/change.rs at line 6
    [5.2088]
    [5.189470]
    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>,
    [5.189514]
    [5.123]
    #[clap(flatten)]
    base: RepoPath,
  • replacement in pijul/src/commands/change.rs at line 21
    [5.2495][4.2942:3012]()
    let repo = Repository::find_root(self.repo_path.as_deref())?;
    [5.2495]
    [5.189800]
    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 {
    [5.190246]
    [5.197]
    let (channel_name, _) = get_channel(None, &txn);
    let Some(channel) = txn.load_channel(channel_name)? else {