Edits can delete lines too

pmeunier
Dec 2, 2021, 10:21 AM
MQ7TZOT6IEHNNSO6D333K4V6TO23D6CL7NKPZGTMNDBJR5QTUIFAC

Dependencies

  • [2] 5FI6SBEZ Re-implement change printing and parsing
  • [3] AF5AKUTO Cleanup after the text changes refactoring
  • [4] FGIVSUFH Fixing conflicts with the new patch parsing code, and introducing AddRoot

Change contents

  • replacement in libpijul/src/change/printable.rs at line 455
    [2.48420][2.48420:48481]()
    print_contents(w, "+", contents, encoding)?;
    [2.48420]
    [2.48481]
    let sign = if let PrintableAtom::Edges(ref e) = change {
    if e[0].flag.deleted {
    "-"
    } else {
    "+"
    }
    } else {
    "+"
    };
    print_contents(w, sign, contents, encoding)?;
  • replacement in libpijul/src/change/parse.rs at line 144
    [2.69024][2.69024:69091]()
    let (i, contents) = parse_contents('+', encoding.clone(), i)?;
    [2.69024]
    [2.69091]
    let (i, contents) = if let Ok(s) = parse_contents('+', encoding.clone(), i) {
    s
    } else {
    parse_contents('-', encoding.clone(), i)?
    };
  • replacement in libpijul/src/change/parse.rs at line 360
    [2.74715][2.74715:74871]()
    Ok((i, vec))
    } else {
    Err(nom::Err::Error(nom::error::Error::new(
    i,
    nom::error::ErrorKind::Verify,
    )))
    [2.74715]
    [2.74871]
    if !vec.is_empty() {
    return Ok((i, vec))
    }
  • edit in libpijul/src/change/parse.rs at line 364
    [2.74877]
    [2.74877]
    Err(nom::Err::Error(nom::error::Error::new(
    i,
    nom::error::ErrorKind::Verify,
    )))