Fixing a bug with empty new files, and another one with empty replacements

[?]
Feb 1, 2021, 9:17 PM
EQLDTLXVCARE36EJE3S6SNEVTW2JJY4EYD36EX7WSIFLG2XMKKQAC

Dependencies

  • [2] 65S67T3E Parsing \\ for empty additions (rare problem)
  • [3] CUHXXBDZ Fixing a bug in replacements, recently introduced during a fix of a graph corruption bug
  • [4] HQ56ADNS Formatting, and version bump
  • [5] IYJZVLET Cleaning up the literate programming bits
  • [6] BZCGXVS7 Fixing two bugs around conflicts on the last line, where invalid patches were produced (first bug) and applied (second bug)
  • [7] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [8] KVBLRDOU Concatenating edits with order conflict resolutions (if relevant), and parsing the text format of the result
  • [9] VO5OQW4W Removing anyhow in libpijul
  • [10] 6YMDOZIB Refactoring apply
  • [11] CCFJ7VO3 Renaming "Record" to "Hunk" in the changes

Change contents

  • replacement in libpijul/src/record.rs at line 291
    [4.497247][4.497247:497313]()
    if self.rec.contents.len() as u64 > inode_pos.0 + 1 {
    [4.497247]
    [4.497313]
    if end > start {
  • edit in libpijul/src/diff/replace.rs at line 63
    [4.781789]
    [4.781789]
    if start >= end {
    return;
    }
  • edit in libpijul/src/diff/replace.rs at line 75
    [4.45][3.119:145](),[3.145][4.0:20](),[4.93][4.0:20](),[4.20][4.112:122](),[4.112][4.112:122]()
    if start >= end {
    return;
    }
  • replacement in libpijul/src/change/text_changes.rs at line 810
    [4.68732][4.68732:68816](),[4.68816][2.0:174](),[2.174][4.68897:69085](),[4.68897][4.68897:69085]()
    if let Some(Atom::NewVertex(ref mut contents)) = contents {
    if contents.end > contents.start
    && contents_[contents.end.0 as usize - 1] == b'\n'
    {
    assert_eq!(contents.end.0 as usize, contents_.len());
    contents_.pop();
    contents.end.0 -= 1;
    [4.68732]
    [4.69085]
    if let Some(Atom::NewVertex(mut c)) = contents.take() {
    if c.end > c.start {
    if contents_[c.end.0 as usize - 1] == b'\n' {
    assert_eq!(c.end.0 as usize, contents_.len());
    contents_.pop();
    c.end.0 -= 1;
    }
    *contents = Some(Atom::NewVertex(c))