push/pull: fixed "changes" arguments

[?]
Nov 16, 2020, 7:54 PM
5HF7C67M4DZMYTCIG32XEQQ662AHQMIHTHUK7TAVSO52XLMFBZPAC

Dependencies

  • [2] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).

Change contents

  • replacement in pijul/src/commands/pushpull.rs at line 56
    [2.113201][2.113201:113226]()
    #[clap(short = 'a')]
    [2.113201]
    [2.113226]
    #[clap(long = "all", short = 'a', conflicts_with = "changes")]
  • edit in pijul/src/commands/pushpull.rs at line 60
    [2.113328][2.113328:113380]()
    #[clap(last = true)]
    changes: Vec<String>,
  • edit in pijul/src/commands/pushpull.rs at line 62
    [2.113433][2.113433:113434]()
  • edit in pijul/src/commands/pushpull.rs at line 65
    [2.113523]
    [2.113523]
    #[clap(last = true, about = "Push only these changes")]
    changes: Vec<String>,
  • replacement in pijul/src/commands/pushpull.rs at line 75
    [2.113691][2.113691:113730]()
    #[clap(long = "all", short = 'a')]
    [2.113691]
    [2.113730]
    #[clap(long = "all", short = 'a', conflicts_with = "changes")]
  • edit in pijul/src/commands/pushpull.rs at line 79
    [2.113832][2.113832:113833]()
  • edit in pijul/src/commands/pushpull.rs at line 84
    [2.113993]
    [2.113993]
    #[clap(long = "path")]
    path: Option<String>,
    from: Option<String>,
    #[clap(long = "from-channel")]
    from_channel: Option<String>,
  • edit in pijul/src/commands/pushpull.rs at line 94
    [2.114195][2.114195:114345]()
    #[clap(long = "path")]
    path: Option<String>,
    from: Option<String>,
    #[clap(long = "from-channel")]
    from_channel: Option<String>,
  • edit in pijul/src/commands/pushpull.rs at line 163
    [2.116824][2.116824:116895]()
    }
    if to_upload.is_empty() {
    return Ok(());
  • edit in pijul/src/commands/pushpull.rs at line 164
    [2.116905][2.116905:116906]()
  • replacement in pijul/src/commands/pushpull.rs at line 166
    [2.116982][2.116982:117021]()
    let to_upload = if !self.all {
    [2.116982]
    [2.117021]
    let to_upload = if !self.changes.is_empty() {
    let mut u = Vec::new();
    let mut not_found = Vec::new();
    for change in self.changes.iter() {
    match txn.hash_from_prefix(change) {
    Ok((hash,_)) => if to_upload.contains(&hash) {
    u.push(hash);
    }
    Err(_) => if !not_found.contains(change) {
    not_found.push(change.to_string());
    }
    }
    }
    if !not_found.is_empty() {
    return Err((crate::Error::ChangesNotFound { hashes: not_found}).into());
    }
    check_deps(&repo.changes, &to_upload, &u)?;
    u
    } else if self.all {
    to_upload
    } else {
  • edit in pijul/src/commands/pushpull.rs at line 193
    [2.117222][2.117222:117261]()
    } else {
    to_upload
  • edit in pijul/src/commands/pushpull.rs at line 195
    [2.117319]
    [2.117319]
    if to_upload.is_empty() {
    return Ok(());
    }