Fixing two bugs around conflicts on the last line, where invalid patches were produced (first bug) and applied (second bug)

[?]
Jan 27, 2021, 3:19 PM
BZCGXVS77ZS3N4QPLIHNWZ3YFVV7H4PXQD3U6RN5ZFVOC7QL7MBQC

Dependencies

  • [2] GHO6DWPI Refactoring iterators
  • [3] ZRUPLBBT Colours in diff and change: separating concerns and dependencies
  • [4] VO5OQW4W Removing anyhow in libpijul
  • [5] CIEUBH46 Fixing an index-out-of-bounds error when serialising bad changes
  • [6] CCFJ7VO3 Renaming "Record" to "Hunk" in the changes
  • [*] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [*] KVBLRDOU Concatenating edits with order conflict resolutions (if relevant), and parsing the text format of the result

Change contents

  • edit in libpijul/src/pristine/sanakirja.rs at line 1337
    [2.45598]
    [2.45598]
    assert!(pos > key.start);
    assert!(pos < key.end);
  • edit in libpijul/src/diff/replace.rs at line 72
    [9.45]
    [8.782161]
    if start <= end {
    return
    }
  • edit in libpijul/src/change/text_changes.rs at line 432
    [3.53313][3.53313:53356]()
    writeln!(w, "\\")?
  • edit in libpijul/src/change/text_changes.rs at line 432
    [3.53313]
    [3.53356]
    writeln!(w, "\n\\")?
  • edit in libpijul/src/change/text_changes.rs at line 1236
    [3.85615][3.85615:85650]()
    writeln!(w, "\\")?
  • edit in libpijul/src/change/text_changes.rs at line 1236
    [3.85615]
    [3.85650]
    writeln!(w, "\n\\")?
  • edit in libpijul/src/apply.rs at line 414
    [8.955847]
    [8.955847]
    if txn.find_block_end(graph, vertex.end_pos()).is_ok()
    || txn.find_block(graph, vertex.start_pos()).is_ok() {
    error!("Invalid change: {:?}", vertex);
    return Err(LocalApplyError::InvalidChange);
    }