roundtrip text encoding when recording

[?]
Mar 20, 2021, 6:40 AM
NG3Z3DOKDZQDQ7UNQEOMXWX2NJKKLM7DKRWW3KIUD7QEECTNQIZQC

Dependencies

  • [2] PDTUHOMV fix left over conflicts
  • [3] IACED7RW text_encoding module
  • [4] YN63NUZO Sanakirja 1.0
  • [5] VO5OQW4W Removing anyhow in libpijul
  • [6] UM5DLRPB store new non-UTF-8 files raw and decode to deplay the contents
  • [7] Q3GU26WD merge with changes from sanakirja v1.1.2
  • [8] 65S67T3E Parsing \\ for empty additions (rare problem)
  • [9] EQLDTLXV Fixing a bug with empty new files, and another one with empty replacements
  • [10] IIV3EL2X Cleanup, formatting, and fixing the Git feature
  • [11] XR7MNOMU file encoding in updates
  • [12] 73NW2X2M Returning a parse error instead of panicking when parsing a text change
  • [13] CCFJ7VO3 Renaming "Record" to "Hunk" in the changes

Change contents

  • edit in libpijul/src/text_encoding.rs at line 23
    [3.601]
    [3.601]
    pub(crate) fn encode(&self, text: &str) -> Vec<u8> {
    let (encoded, ..) = self.0.encode(text);
    encoded.into_owned().to_vec()
    }
  • edit in libpijul/src/change/text_changes.rs at line 847
    [4.67725]
    [4.67725]
    encoding,
  • replacement in libpijul/src/change/text_changes.rs at line 867
    [4.68539][4.68539:68624]()
    text_changes::parse_line_add(h, contents, contents_)
    [4.68539]
    [4.68624]
    text_changes::parse_line_add(h, contents, contents_, encoding)
  • replacement in libpijul/src/change/text_changes.rs at line 972
    [4.73304][4.9965:10026]()
    Some(Hunk::Edit { ref mut change, .. }) => {
    [4.73304]
    [4.73367]
    Some(Hunk::Edit {
    ref mut change,
    encoding,
    ..
    }) => {
  • replacement in libpijul/src/change/text_changes.rs at line 983
    [4.73707][4.73707:73786]()
    text_changes::parse_line_add(h, change, contents_)
    [4.73707]
    [4.73786]
    text_changes::parse_line_add(h, change, contents_, encoding)
  • edit in libpijul/src/change/text_changes.rs at line 1013
    [4.75183]
    [4.75183]
    encoding,
  • replacement in libpijul/src/change/text_changes.rs at line 1021
    [4.75523][4.75523:75600]()
    text_changes::parse_line_add(h, repl, contents_)
    [4.75523]
    [4.75600]
    text_changes::parse_line_add(h, repl, contents_, encoding)
  • replacement in libpijul/src/change/text_changes.rs at line 1063
    [4.77707][4.77707:77786]()
    text_changes::parse_line_add(h, change, contents_)
    [4.77707]
    [4.77786]
    // TODO encoding
    text_changes::parse_line_add(h, change, contents_, &None)
  • replacement in libpijul/src/change/text_changes.rs at line 1251
    [4.84069][4.84069:84191]()
    pub fn parse_line_add(h: &str, change: &mut NewVertex<Option<Hash>>, contents_: &mut Vec<u8>) {
    let h = h.as_bytes();
    [4.84069]
    [4.84191]
    pub fn parse_line_add(
    h: &str,
    change: &mut NewVertex<Option<Hash>>,
    contents_: &mut Vec<u8>,
    encoding: &Option<Encoding>,
    ) {
    let h = match encoding {
    Some(encoding) => encoding.encode(h),
    None => String::from(h).into_bytes(),
    };
  • edit in libpijul/src/change/text_changes.rs at line 1317
    [4.143228][2.1:1]()