Refactor debug command's handling of repo and channel

dblsaiko
Mar 29, 2024, 9:21 PM
YMCFR3BMW6OIR67YH5I7KFOFGA7PAKPLQFBXQJOYZ5N37NLSF3WAC

Dependencies

  • [2] MQ6ERQ43 Bug fixes when unrecording a patch that introduced zombie files
  • [3] Y2Y4OOIE Move `pijul::DEFAULT_CHANNEL` to `libpijul`
  • [4] QQS7LII4 Add value hints to arguments
  • [5] GKSVBEUW Refactor Repository constructors to take Option<&Path> instead of Option<PathBuf>
  • [6] CCLLB7OI Upgrading to Sanakirja 0.15 + version bump
  • [7] L4JXJHWX pijul/*: reorganize imports and remove extern crate
  • [8] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [9] JL4WKA5P Implement the Sanakirja concurrency model in a cross-process way
  • [10] I24UEJQL Various post-fire fixes
  • [11] 5OGOE4VW Store the current channel in the pristine
  • [12] 5BRU2RRW Cleanup (debugging a crash related to trees/inodes)
  • [13] AEPEFS7O Write help for each argument
  • [14] HMMMKONL Fixing alive vertices
  • [15] I7VL7VPZ Minor cleanup
  • [16] A3RM526Y Integrating identity malleability
  • [17] 74HX2XZD Cleanup and debugging
  • [18] 4H2XTVJ2 Fix some mistakes in the docs
  • [19] RUBBHYZ7 Removing unnecessary async/await
  • [20] PIQCNEEB Upgrading to Clap 3.0.0-alpha.5
  • [21] I52XSRUH Massive cleanup, and simplification
  • [22] BD5PC25A Deleting conflict resolution vertices when the sides are deleted
  • [23] X243Z3Y5 Recording only the required metadata (can even be changed later!)
  • [24] Y6EVFMTA Don't output files if they aren't in the current channel
  • [25] ABQDWHNG Migrate 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};
    [6.177758]
    [2.0]
    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>,
    [6.177879]
    [6.21028]
    #[clap(flatten)]
    base: RepoAndChannel,
  • replacement in pijul/src/commands/debug.rs at line 19
    [6.2252][5.2396:2466]()
    let repo = Repository::find_root(self.repo_path.as_deref())?;
    [6.2252]
    [6.178130]
    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)
    };
    [6.178176]
    [6.21092]
    let (channel, _) = load_channel(self.base.channel(), &txn)?;