file_operations: remove the counter-intuitive --repository options

pmeunier
Jul 7, 2021, 12:43 PM
RG4YZPKLWZXRNROBZQD4OLWMF46JPZC4WAM3Q6DBLDQYLL4QNQBQC

Dependencies

  • [2] W5HHTRPK Rename the `mv` command to `move`
  • [3] A3RM526Y Integrating identity malleability
  • [4] PP3E3TRE Do not move source if destination is wrong
  • [5] TZVUNELW Documentation comments
  • [6] CCLLB7OI Upgrading to Sanakirja 0.15 + version bump
  • [7] KWAMD2KR A few fixes in the documentation comments
  • [8] JL4WKA5P Implement the Sanakirja concurrency model in a cross-process way
  • [9] I24UEJQL Various post-fire fixes
  • [10] 4OCC6D42 Recursive add
  • [11] ZBNKSYA6 Fixing a bus error when starting a transaction on a full disk
  • [12] Y7YAFMFF Fix path prefix striping on Windows.
  • [13] 4H2XTVJ2 Fix some mistakes in the docs
  • [14] EEOOHGQQ More atomic "file moves+transaction"
  • [15] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [16] AEPEFS7O Write help for each argument
  • [17] 3H6Q5LDS Fixing a bug with the salt argument in `mv`
  • [18] YN63NUZO Sanakirja 1.0
  • [19] LBVUI6AX Rename `ls` command to `list`

Change contents

  • edit in pijul/src/commands/file_operations.rs at line 14
    [2.96][4.2111:2261](),[4.169248][4.2111:2261](),[4.2261][4.169248:169313](),[4.2581][4.169248:169313](),[4.3663][4.169248:169313](),[4.169248][4.169248:169313](),[4.169313][4.32:33]()
    /// 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>,
  • replacement in pijul/src/commands/file_operations.rs at line 25
    [4.14796][3.23739:23806]()
    let repo = Repository::find_root(self.repo_path.clone())?;
    [4.14796]
    [4.169474]
    let repo = Repository::find_root(None)?;
  • edit in pijul/src/commands/file_operations.rs at line 31
    [4.169598][4.169598:169642]()
    let to = path(&self.repo_path, to);
  • replacement in pijul/src/commands/file_operations.rs at line 44
    [4.169973][4.169973:170128]()
    let source = std::fs::canonicalize(&path(&self.repo_path, p.clone()))?;
    let target = if is_dir { to.join(p) } else { to.clone() };
    [4.169973]
    [4.170128]
    let source = std::fs::canonicalize(&p.clone())?;
    debug!("source = {:?}", source);
    let target = if is_dir {
    to.join(source.file_name().unwrap())
    } else {
    to.clone()
    };
  • edit in pijul/src/commands/file_operations.rs at line 59
    [4.252]
    [4.58]
    debug!("target = {:?}", target);
  • edit in pijul/src/commands/file_operations.rs at line 87
    [4.484][4.170595:170743](),[4.170595][4.170595:170743]()
    fn path(root: &Option<PathBuf>, path: PathBuf) -> PathBuf {
    if let Some(ref p) = root {
    p.join(path)
    } else {
    path
    }
    }
  • edit in pijul/src/commands/file_operations.rs at line 109
    [4.171231][4.2413:2563](),[4.330][4.171231:171296](),[4.2563][4.171231:171296](),[4.2881][4.171231:171296](),[4.171231][4.171231:171296]()
    /// 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>,
  • replacement in pijul/src/commands/file_operations.rs at line 121
    [4.15113][3.23867:23934]()
    let repo = Repository::find_root(self.repo_path.clone())?;
    [4.15113]
    [4.19543]
    let repo = Repository::find_root(None)?;
  • edit in pijul/src/commands/file_operations.rs at line 179
    [4.172507][4.172507:172540](),[4.172540][4.2564:2714](),[4.2714][4.172540:172572](),[4.3031][4.172540:172572](),[4.4088][4.172540:172572](),[4.172540][4.172540:172572]()
    #[clap(long = "repository")]
    /// Set the repository where this command should run. Defaults to the first ancestor of the current directory that contains a `.pijul` directory.
    repo_path: Option<PathBuf>,
  • replacement in pijul/src/commands/file_operations.rs at line 185
    [4.15285][3.23935:24002]()
    let repo = Repository::find_root(self.repo_path.clone())?;
    [4.15285]
    [4.732]
    let repo = Repository::find_root(None)?;