Refactor protocol command's handling of repo and channel

dblsaiko
Mar 29, 2024, 9:36 PM
7MFC7MVAFNDP4ANWQN25ASBGT4DLLRJ3GKAT4DS56EBKSMUDSDEQC

Dependencies

  • [2] GKSVBEUW Refactor Repository constructors to take Option<&Path> instead of Option<PathBuf>
  • [3] PIQCNEEB Upgrading to Clap 3.0.0-alpha.5
  • [4] A3RM526Y Integrating identity malleability
  • [5] 5SLOJYHG Fixing the Git feature
  • [6] 4H2XTVJ2 Fix some mistakes in the docs
  • [7] I52XSRUH Massive cleanup, and simplification
  • [8] ZZXBHCN3 fixing the protocol
  • [9] CCLLB7OI Upgrading to Sanakirja 0.15 + version bump
  • [10] KWAMD2KR A few fixes in the documentation comments
  • [11] JL4WKA5P Implement the Sanakirja concurrency model in a cross-process way
  • [12] EUZFFJSO Updating Pijul with the latest changes in Libpijul
  • [13] OGJFEWHU Fixing missing dependencies on partial clones
  • [14] RUBBHYZ7 Removing unnecessary async/await
  • [15] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [16] WW2EOFBB Umask in archives
  • [17] AEPEFS7O Write help for each argument
  • [18] L5IUD2DS Fixing the regular expression parsing the protocol lines
  • [19] WZVCLZKY address clippy lints
  • [20] 7ZROQSSN Handling TAG uploads from the `pijul protocol` command
  • [21] DO2Y5TY5 Tag synchronisation
  • [*] L4JXJHWX pijul/*: reorganize imports and remove extern crate

Change contents

  • edit in pijul/src/commands/protocol.rs at line 7
    [23.1914]
    [3.15113]
    use crate::commands::common_opts::RepoPath;
    use crate::commands::load_channel_exact;
  • replacement in pijul/src/commands/protocol.rs at line 22
    [3.123656][3.1117:1267](),[3.1267][3.123656:123721](),[3.1965][3.123656:123721](),[3.2698][3.123656:123721](),[3.123656][3.123656:123721]()
    /// 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")]
    repo_path: Option<PathBuf>,
    [3.123656]
    [3.2699]
    #[clap(flatten)]
    base: RepoPath,
  • edit in pijul/src/commands/protocol.rs at line 44
    [3.124435][3.15150:15291](),[3.15291][3.124564:124591](),[3.124564][3.124564:124591](),[3.124591][3.15292:15337](),[3.15337][3.124694:124703](),[3.124694][3.124694:124703]()
    fn load_channel<T: MutTxnTExt>(txn: &T, name: &str) -> Result<ChannelRef<T>, anyhow::Error> {
    if let Some(c) = txn.load_channel(name)? {
    Ok(c)
    } else {
    bail!("No such channel: {:?}", name)
    }
    }
  • replacement in pijul/src/commands/protocol.rs at line 48
    [3.1528][2.1857:1931]()
    let mut repo = Repository::find_root(self.repo_path.as_deref())?;
    [3.1528]
    [3.3472]
    let mut repo = Repository::find_root(self.base.repo_path())?;
  • replacement in pijul/src/commands/protocol.rs at line 64
    [3.15889][3.11419:11487]()
    let channel = load_channel(&*txn.read(), &cap[1])?;
    [3.15889]
    [3.11487]
    let channel = load_channel_exact(&cap[1], &*txn.read())?;
  • replacement in pijul/src/commands/protocol.rs at line 69
    [3.16129][3.11528:11596]()
    let channel = load_channel(&*txn.read(), &cap[1])?;
    [3.16129]
    [3.125525]
    let channel = load_channel_exact(&cap[1], &*txn.read())?;
  • replacement in pijul/src/commands/protocol.rs at line 120
    [3.126588][3.11766:11834]()
    let channel = load_channel(&*txn.read(), &cap[1])?;
    [3.126588]
    [3.126648]
    let channel = load_channel_exact(&cap[1], &*txn.read())?;
  • replacement in pijul/src/commands/protocol.rs at line 181
    [3.34918][3.137:209](),[3.137][3.137:209]()
    let channel = load_channel(&*txn.read(), &cap[2])?;
    [3.34918]
    [3.209]
    let channel = load_channel_exact(&cap[2], &*txn.read())?;
  • replacement in pijul/src/commands/protocol.rs at line 267
    [3.130373][3.12035:12103]()
    let channel = load_channel(&*txn.read(), &cap[1])?;
    [3.130373]
    [3.626]
    let channel = load_channel_exact(&cap[1], &*txn.read())?;
  • replacement in pijul/src/commands/protocol.rs at line 281
    [3.131201][3.12279:12347]()
    let channel = load_channel(&*txn.read(), &cap[1])?;
    [3.131201]
    [3.131261]
    let channel = load_channel_exact(&cap[1], &*txn.read())?;