Don't output files if they aren't in the current channel

[?]
Feb 26, 2021, 10:53 AM
Y6EVFMTA6FOH3OQH6QCSWMI3F6SYZT2FSHO6GF4M3ICENDCWFM4QC

Dependencies

  • [2] MHQBEHJD unrecord --reset without a pending change
  • [3] I7VL7VPZ Minor cleanup
  • [4] MDADYULS Fix a panic when switching between channels that have different files
  • [5] I52XSRUH Massive cleanup, and simplification
  • [6] Y7YAFMFF Fix path prefix striping on Windows.
  • [7] HMMMKONL Fixing alive vertices
  • [8] VL7ZYKHB Running hooks through shell on Windows and Unix
  • [9] K6GWUOD5 Styling progress bars
  • [10] MU5GSJAW Partial push and pull (WARNING: breaks the existing protocol)
  • [11] NLGQAH4H Credit and reset relative to current directory instead of the root
  • [12] VQPAUKBQ channel switch as an alias to reset
  • [13] CCLLB7OI Upgrading to Sanakirja 0.15 + version bump
  • [14] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [15] 5BRU2RRW Cleanup (debugging a crash related to trees/inodes)
  • [16] 3KRGVQFU Do not update the mtime of unmodified files
  • [17] JL4WKA5P Implement the Sanakirja concurrency model in a cross-process way
  • [18] QWD7UE76 push/pull: rename `channel` option
  • [19] WZVCLZKY address clippy lints
  • [20] YN63NUZO Sanakirja 1.0
  • [21] A6R6SGCP Fixing a panic in `pijul change`
  • [22] XA23FMQM Reset only files that have been modified
  • [23] LGEJSLTY Fixing output (including its uses in reset and pull)
  • [24] 5DVRL6MF Hard-unrecord
  • [25] YAJAXIV5 Unrecording changes atomically
  • [26] VMPAOJS2 Don't output after pushing to a local channel
  • [27] 76PCXGML Pushing to, and pulling from the local repository

Change contents

  • replacement in pijul/src/config.rs at line 141
    [5.91314][3.0:80]()
    pub fn get_current_channel<'a>(&'a self, alt: Option<&'a str>) -> &'a str {
    [5.91314]
    [5.91397]
    pub fn get_current_channel<'a>(&'a self, alt: Option<&'a str>) -> (&'a str, bool) {
  • replacement in pijul/src/config.rs at line 143
    [5.91434][5.91434:91463]()
    channel.as_ref()
    [5.91434]
    [5.91463]
    (channel.as_ref(), alt == self.current_channel.as_deref())
  • replacement in pijul/src/config.rs at line 145
    [5.91528][5.91528:91557]()
    channel.as_str()
    [5.91528]
    [5.91557]
    (channel.as_str(), true)
  • replacement in pijul/src/config.rs at line 147
    [5.91574][5.91574:91609]()
    crate::DEFAULT_CHANNEL
    [5.91574]
    [5.83]
    (crate::DEFAULT_CHANNEL, true)
  • replacement in pijul/src/commands/unrecord.rs at line 37
    [5.96273][3.81:166]()
    let channel_name = repo.config.get_current_channel(self.channel.as_deref());
    [5.96273]
    [5.96356]
    let (channel_name, is_current_channel) =
    repo.config.get_current_channel(self.channel.as_deref());
  • replacement in pijul/src/commands/unrecord.rs at line 118
    [5.97582][2.0:28]()
    if self.reset {
    [5.97582]
    [5.1145]
    if self.reset && is_current_channel {
  • replacement in pijul/src/commands/reset.rs at line 41
    [5.98334][3.167:252]()
    let channel_name = repo.config.get_current_channel(self.channel.as_deref());
    [5.98334]
    [5.39]
    let (channel_name, _) = repo.config.get_current_channel(self.channel.as_deref());
  • replacement in pijul/src/commands/reset.rs at line 70
    [5.99627][5.99627:99700]()
    let current_channel = repo.config.get_current_channel(None);
    [5.99627]
    [5.538]
    let (current_channel, _) = repo.config.get_current_channel(None);
  • replacement in pijul/src/commands/record.rs at line 66
    [5.103624][3.253:352]()
    txn.open_or_create_channel(repo.config.get_current_channel(self.channel.as_deref()))?;
    [5.103624]
    [5.103721]
    txn.open_or_create_channel(repo.config.get_current_channel(self.channel.as_deref()).0)?;
  • replacement in pijul/src/commands/pushpull.rs at line 124
    [5.114607][3.353:385]()
    let channel_name = repo
    [5.114607]
    [3.385]
    let (channel_name, _) = repo
  • replacement in pijul/src/commands/pushpull.rs at line 279
    [5.117701][3.470:558]()
    let channel_name = repo.config.get_current_channel(self.to_channel.as_deref());
    [5.117701]
    [5.117784]
    let (channel_name, is_current_channel) =
    repo.config.get_current_channel(self.to_channel.as_deref());
  • replacement in pijul/src/commands/pushpull.rs at line 456
    [5.1543][5.1543:1544](),[5.1544][5.256:343](),[5.343][4.735:1002]()
    let mut touched_paths: Vec<_> = Vec::new();
    for &i in touched.iter() {
    if let Some((path, _)) =
    libpijul::fs::find_path(&repo.changes, &txn, &channel.borrow(), false, *i)?
    {
    touched_paths.push(path)
    } else {
    touched_paths.clear();
    break;
    [5.1543]
    [4.1002]
    if is_current_channel {
    let mut touched_paths: Vec<_> = Vec::new();
    for &i in touched.iter() {
    if let Some((path, _)) =
    libpijul::fs::find_path(&repo.changes, &txn, &channel.borrow(), false, *i)?
    {
    touched_paths.push(path)
    } else {
    touched_paths.clear();
    break;
    }
    }
    touched_paths.sort();
    let mut last = "";
    for path in touched_paths.iter() {
    if !last.is_empty() && path.starts_with(last) {
    continue;
    }
    debug!("path = {:?}", path);
    txn.output_repository_no_pending(
    &mut repo.working_copy,
    &repo.changes,
    &mut channel,
    path,
    true,
    None,
    )?;
    last = path
  • replacement in pijul/src/commands/pushpull.rs at line 485
    [4.1016][5.469:665](),[5.12120][5.469:665](),[5.469][5.469:665]()
    }
    touched_paths.sort();
    let mut last = "";
    for path in touched_paths.iter() {
    if !last.is_empty() && path.starts_with(last) {
    continue;
    [4.1016]
    [5.665]
    if touched_paths.is_empty() {
    txn.output_repository_no_pending(
    &mut repo.working_copy,
    &repo.changes,
    &mut channel,
    "",
    true,
    None,
    )?;
  • edit in pijul/src/commands/pushpull.rs at line 495
    [5.679][5.1730:1771](),[5.1730][5.1730:1771](),[5.1771][5.10230:10377](),[5.10230][5.10230:10377](),[5.10377][5.680:702](),[5.702][5.10397:10419](),[5.1822][5.10397:10419](),[5.10397][5.10397:10419](),[5.10419][5.445:467](),[5.467][5.10419:10435](),[5.10419][5.10419:10435](),[5.10435][5.703:727]()
    debug!("path = {:?}", path);
    txn.output_repository_no_pending(
    &mut repo.working_copy,
    &repo.changes,
    &mut channel,
    path,
    true,
    None,
    )?;
    last = path
  • edit in pijul/src/commands/pushpull.rs at line 496
    [5.11136][4.1017:1293]()
    if touched_paths.is_empty() {
    txn.output_repository_no_pending(
    &mut repo.working_copy,
    &repo.changes,
    &mut channel,
    "",
    true,
    None,
    )?;
    }
  • replacement in pijul/src/commands/log.rs at line 34
    [5.135052][3.616:701]()
    let channel_name = repo.config.get_current_channel(self.channel.as_deref());
    [5.135052]
    [5.16944]
    let (channel_name, _) = repo.config.get_current_channel(self.channel.as_deref());
  • replacement in pijul/src/commands/fork.rs at line 34
    [5.168764][3.702:791]()
    let channel_name = repo.config.get_current_channel(self.channel.as_deref());
    [5.168764]
    [5.17285]
    let (channel_name, _) = repo.config.get_current_channel(self.channel.as_deref());
  • replacement in pijul/src/commands/diff.rs at line 40
    [5.174301][3.792:891]()
    txn.open_or_create_channel(repo.config.get_current_channel(self.channel.as_deref()))?;
    [5.174301]
    [5.174398]
    txn.open_or_create_channel(repo.config.get_current_channel(self.channel.as_deref()).0)?;
  • replacement in pijul/src/commands/debug.rs at line 25
    [5.5818][3.892:977]()
    let channel_name = repo.config.get_current_channel(self.channel.as_deref());
    [5.5818]
    [5.17729]
    let (channel_name, _) = repo.config.get_current_channel(self.channel.as_deref());
  • replacement in pijul/src/commands/credit.rs at line 30
    [5.179348][3.978:1063]()
    let channel_name = repo.config.get_current_channel(self.channel.as_deref());
    [5.179348]
    [5.18121]
    let (channel_name, _) = repo.config.get_current_channel(self.channel.as_deref());
  • replacement in pijul/src/commands/change.rs at line 29
    [5.190246][5.0:70]()
    let channel_name = repo.config.get_current_channel(None);
    [5.190246]
    [5.19040]
    let (channel_name, _) = repo.config.get_current_channel(None);
  • replacement in pijul/src/commands/archive.rs at line 86
    [5.16572][3.1064:1153]()
    let channel_name = repo.config.get_current_channel(self.channel.as_deref());
    [5.16572]
    [5.193066]
    let (channel_name, _) = repo.config.get_current_channel(self.channel.as_deref());
  • replacement in pijul/src/commands/apply.rs at line 31
    [5.194929][3.1154:1239]()
    let channel_name = repo.config.get_current_channel(self.channel.as_deref());
    [5.194929]
    [5.19373]
    let (channel_name, is_current_channel) =
    repo.config.get_current_channel(self.channel.as_deref());
  • replacement in pijul/src/commands/apply.rs at line 80
    [5.1107][4.1294:1361](),[4.1361][5.1146:1173](),[5.1146][5.1146:1173](),[5.1173][4.1362:1628]()
    let mut touched_files = Vec::with_capacity(touched.len());
    for i in touched {
    if let Some((path, _)) =
    libpijul::fs::find_path(&repo.changes, &txn, &channel.borrow(), false, i)?
    {
    touched_files.push(path)
    } else {
    touched_files.clear();
    break;
    [5.1107]
    [4.1628]
    if is_current_channel {
    let mut touched_files = Vec::with_capacity(touched.len());
    for i in touched {
    if let Some((path, _)) =
    libpijul::fs::find_path(&repo.changes, &txn, &channel.borrow(), false, i)?
    {
    touched_files.push(path)
    } else {
    touched_files.clear();
    break;
    }
    }
    for path in touched_files.iter() {
    txn.output_repository_no_pending(
    &mut repo.working_copy,
    &repo.changes,
    &mut channel,
    &path,
    true,
    None,
    )?;
    }
    if !touched_files.is_empty() {
    txn.output_repository_no_pending(
    &mut repo.working_copy,
    &repo.changes,
    &mut channel,
    "",
    true,
    None,
    )?;
  • edit in pijul/src/commands/apply.rs at line 113
    [4.1652][4.1652:1695](),[4.1695][5.1293:1440](),[5.1293][5.1293:1440](),[5.1467][5.1467:1560](),[5.1560][4.1696:1972]()
    for path in touched_files.iter() {
    txn.output_repository_no_pending(
    &mut repo.working_copy,
    &repo.changes,
    &mut channel,
    &path,
    true,
    None,
    )?;
    }
    if !touched_files.is_empty() {
    txn.output_repository_no_pending(
    &mut repo.working_copy,
    &repo.changes,
    &mut channel,
    "",
    true,
    None,
    )?;
    }