ALKSQF2FA5VUUUU3IMCDOWRB5PL4AXINZUA5I27SGNKQPD6Z7J3QC
AF5AKUTO7AUAWFO5JS4W5BC5IG2F4EB4MGKYC5Q2CWJCVB65ZRYQC
NWIZ65KEIZ7XPPAYBS3B56X7UQHPMPNPUXLB26NQKBMCUV4WN5EQC
L5I5B4PVH7CVP2Y5LRNCM4IPOMVSKA553RTJG7MCM7PS2JQJGAEAC
NBM34JQZ3VLJO4B64WYAXNZVHXPNY2HY57LCWOZNX3UDG7PB2GBAC
YNDPMU3V76TWY4ASOAVRKDDPPXTDOCWPMWRPK3KCN7YMFQGU6DBQC
BU7OHMPWYR4P6WKGBEKH5RPY55AQYFCXH6EAK2JOABVTJLQN3YNQC
5FI6SBEZ6RERERUAIWQJVAY66BEZ7YQOYOUNK2DPOLRGS2X326RAC
OOJNAY34KSQSSIGYA7DLBIGSM6TGWZ66MVU42W3MCCIZ7ZGNS3YQC
UGUWKK3IRZQJFGHOUMW2BWN42PZUS7TZL7X442XXDGQUB3FWW3NQC
FMVDQHHCAL7FZEHK5C2ZCDSRHW6CAZP777PUF7FL2BY4WOXDIYVQC
HW7DZ2B42HNF35ZIJAVB4RMQS6CTKUWX5DBBBVF6P4ZQKHGUCTCQC
YQMLICLW2FABJBX5AQGPZIHICYLECR53TLPEBGUEH23YNKIMKC7AC
HODZ2KUFCFSNV75KD7PP6CYLAD4XPY62DWVCAOKMOJTM65MHJSVQC
4ODDR4JLI3OJSKCIOJZNTWEQC2KRW2VV4I6S4RYMOCRKWUM52DPAC
MQ7TZOT6IEHNNSO6D333K4V6TO23D6CL7NKPZGTMNDBJR5QTUIFAC
FGIVSUFHH7DN65DYQHDGGDDCHHIB5Z7KKQWI4I3WMERE3BY6IMRQC
let (i, name) = preceded(space0, parse_string)(i)?;
let (i, perms) = preceded(space0, parse_perms)(i)?;
let (i, pos) = preceded(space0, parse_printable_pos)(i)?;
let (i, _) = tuple((space0, line_ending))(i)?;
let parse = |i, path| -> IResult<&str, PrintableHunk> {
let (i, name) = preceded(space0, parse_string)(i)?;
let (i, perms) = preceded(space0, parse_perms)(i)?;
let (i, pos) = preceded(space0, parse_printable_pos)(i)?;
let (i, _) = tuple((space0, line_ending))(i)?;
let (i, up_context) = preceded(pair(space0, tag("up")), parse_context)(i)?;
let (i, down_context) = preceded(pair(space0, tag(", down")), parse_context)(i)?;
let (i, _) = line_ending(i)?;
Ok((
i,
FileMoveV {
path,
name,
perms,
pos,
up_context,
down_context,
del,
},
))
let (i, up_context) = preceded(pair(space0, tag("up")), parse_context)(i)?;
let (i, down_context) = preceded(pair(space0, tag(", down")), parse_context)(i)?;
let (i, _) = line_ending(i)?;
Ok((
i,
FileMoveV {
path,
name,
perms,
pos,
up_context,
down_context,
del,
},
))
};
parse(i, path)
.map_err(|_| nom::Err::Error(nom::error::Error::new(i, nom::error::ErrorKind::Verify)))
let (i, pos) = preceded(space0, parse_printable_pos)(i)?;
let (i, _) = tuple((space0, line_ending))(i)?;
let parse = |i, path| -> IResult<&str, PrintableHunk> {
let (i, pos) = preceded(space0, parse_printable_pos)(i)?;
let (i, _) = tuple((space0, line_ending))(i)?;
let (i, add) = parse_edges(i)?;
let (i, del) = parse_edges(i)?;
Ok((
i,
FileMoveE {
path,
pos,
add,
del,
},
))
let (i, add) = parse_edges(i)?;
let (i, del) = parse_edges(i)?;
Ok((
i,
FileMoveE {
path,
pos,
add,
del,
},
))
};
parse(i, path)
.map_err(|_| nom::Err::Error(nom::error::Error::new(i, nom::error::ErrorKind::Verify)))
let (i, pos) = preceded(space0, parse_printable_pos)(i)?;
let (i, encoding) = preceded(space0, parse_encoding)(i)?;
let (i, _) = tuple((space0, line_ending))(i)?;
let (i, del_edges) = parse_edges(i)?;
let (i, content_edges) = map(opt(parse_edges), |o| o.unwrap_or(Vec::new()))(i)?;
let (i, contents) = if encoding.is_none() {
debug!("encoding none");
// If the encoding is binary, we may have a base64 version of
// the file.
if let Ok((i, c)) = parse_contents('-', encoding.clone(), i) {
(i, c)
let parse = |i, path| -> IResult<&str, PrintableHunk> {
let (i, pos) = preceded(space0, parse_printable_pos)(i)?;
let (i, encoding) = preceded(space0, parse_encoding)(i)?;
let (i, _) = tuple((space0, line_ending))(i)?;
let (i, del_edges) = parse_edges(i)?;
let (i, content_edges) = map(opt(parse_edges), |o| o.unwrap_or(Vec::new()))(i)?;
let (i, contents) = if encoding.is_none() {
debug!("encoding none");
// If the encoding is binary, we may have a base64 version of
// the file.
if let Ok((i, c)) = parse_contents('-', encoding.clone(), i) {
(i, c)
} else {
(i, Vec::new())
}
Ok((
i,
FileDel {
path,
pos,
encoding,
del_edges,
content_edges,
contents,
},
))
parse(i, path)
.map_err(|_| nom::Err::Error(nom::error::Error::new(i, nom::error::ErrorKind::Verify)))
let (i, pos) = preceded(space0, parse_printable_pos)(i)?;
let (i, encoding) = preceded(space0, parse_encoding)(i)?;
let (i, _) = tuple((space0, line_ending))(i)?;
let (i, undel_edges) = parse_edges(i)?;
let (i, content_edges) = map(opt(parse_edges), |o| o.unwrap_or(Vec::new()))(i)?;
let (i, contents) = if let Ok(x) = parse_contents('+', encoding.clone(), i) {
x
} else {
// Contents is optional for FileUndel hunks.
(i, Vec::new())
let parse = |i, path| -> IResult<&str, PrintableHunk> {
let (i, pos) = preceded(space0, parse_printable_pos)(i)?;
let (i, encoding) = preceded(space0, parse_encoding)(i)?;
let (i, _) = tuple((space0, line_ending))(i)?;
let (i, undel_edges) = parse_edges(i)?;
let (i, content_edges) = map(opt(parse_edges), |o| o.unwrap_or(Vec::new()))(i)?;
let (i, contents) = if let Ok(x) = parse_contents('+', encoding.clone(), i) {
x
} else {
// Contents is optional for FileUndel hunks.
(i, Vec::new())
};
Ok((
i,
FileUndel {
path,
pos,
encoding,
undel_edges,
content_edges,
contents,
},
))
let (i, parent) = preceded(delimited(space1, tag("in"), space1), parse_string)(i)?;
let (i, perms) = preceded(space0, parse_perms)(i)?;
let (i, encoding) = preceded(space0, parse_encoding)(i)?;
let (i, _) = tuple((space0, line_ending, multispace0))(i)?;
let parse = |i, name| -> IResult<&str, PrintableHunk> {
let (i, parent) = preceded(delimited(space1, tag("in"), space1), parse_string)(i)?;
let (i, perms) = preceded(space0, parse_perms)(i)?;
let (i, encoding) = preceded(space0, parse_encoding)(i)?;
let (i, _) = tuple((space0, line_ending, multispace0))(i)?;
let (i, up_context) = preceded(tag("up"), parse_context)(i)?;
let (i, (start, end)) = delimited(space0, parse_start_end, pair(space0, line_ending))(i)?;
let (i, contents) = if let PrintablePerms::IsDir = perms {
(i, Vec::new())
} else {
parse_contents('+', encoding.clone(), i)?
let (i, up_context) = preceded(tag("up"), parse_context)(i)?;
let (i, (start, end)) = delimited(space0, parse_start_end, pair(space0, line_ending))(i)?;
let (i, contents) = if let PrintablePerms::IsDir = perms {
(i, Vec::new())
} else {
parse_contents('+', encoding.clone(), i)?
};
Ok((
i,
FileAddition {
name,
parent,
perms,
encoding,
up_context,
start,
end,
contents,
},
))
Ok((
i,
FileAddition {
name,
parent,
perms,
encoding,
up_context,
start,
end,
contents,
},
))
parse(i, name)
.map_err(|_| nom::Err::Error(nom::error::Error::new(i, nom::error::ErrorKind::Verify)))
let (i, line) = preceded(char(':'), u64)(i)?;
let (i, pos) = preceded(space0, parse_printable_pos)(i)?;
let (i, encoding) = preceded(space0, parse_encoding)(i)?;
let (i, _) = tuple((space0, line_ending))(i)?;
let (i, change) = parse_atom(i)?;
let (i, contents_plus) = parse_contents('+', encoding.clone(), i)?;
let (i, contents_minus) = parse_contents('-', encoding.clone(), i)?;
let contents = if contents_plus.is_empty() {
if contents_minus.is_empty() {
return Err(nom::Err::Error(nom::error::Error::new(
i,
nom::error::ErrorKind::Verify,
)))
let parse = |i, path| -> IResult<&str, PrintableHunk> {
let (i, line) = preceded(char(':'), u64)(i)?;
let (i, pos) = preceded(space0, parse_printable_pos)(i)?;
let (i, encoding) = preceded(space0, parse_encoding)(i)?;
let (i, _) = tuple((space0, line_ending))(i)?;
let (i, change) = parse_atom(i)?;
let (i, contents_plus) = parse_contents('+', encoding.clone(), i)?;
let (i, contents_minus) = parse_contents('-', encoding.clone(), i)?;
let contents = if contents_plus.is_empty() {
if contents_minus.is_empty() {
return Err(nom::Err::Error(nom::error::Error::new(
i,
nom::error::ErrorKind::Verify,
)));
} else {
contents_minus
}
contents_minus
}
} else {
contents_plus
contents_plus
};
Ok((
i,
Edit {
path,
line: line as usize,
pos,
encoding,
change,
contents,
},
))
let (i, line) = preceded(char(':'), u64)(i)?;
let (i, pos) = preceded(space0, parse_printable_pos)(i)?;
let (i, encoding) = preceded(space0, parse_encoding)(i)?;
let (i, _) = tuple((space0, line_ending))(i)?;
// TODO: allow line_endings in between these lines
let (i, change) = parse_edges(i)?;
let (i, replacement) = parse_new_vertex(i)?;
let (i, change_contents) = parse_contents('-', encoding.clone(), i)?;
let (i, replacement_contents) = parse_contents('+', encoding.clone(), i)?;
Ok((
i,
Replace {
path,
line: line as usize,
pos,
encoding,
change,
replacement,
change_contents,
replacement_contents,
},
))
let parse = |i, path| -> IResult<&str, PrintableHunk> {
let (i, line) = preceded(char(':'), u64)(i)?;
let (i, pos) = preceded(space0, parse_printable_pos)(i)?;
let (i, encoding) = preceded(space0, parse_encoding)(i)?;
let (i, _) = tuple((space0, line_ending))(i)?;
// TODO: allow line_endings in between these lines
let (i, change) = parse_edges(i)?;
let (i, replacement) = parse_new_vertex(i)?;
let (i, change_contents) = parse_contents('-', encoding.clone(), i)?;
let (i, replacement_contents) = parse_contents('+', encoding.clone(), i)?;
Ok((
i,
Replace {
path,
line: line as usize,
pos,
encoding,
change,
replacement,
change_contents,
replacement_contents,
},
))
};
parse(i, path)
.map_err(|_| nom::Err::Error(nom::error::Error::new(i, nom::error::ErrorKind::Verify)))
let (i, pos) = preceded(space0, parse_printable_pos)(i)?;
let (i, _) = tuple((space0, char(':'), space0))(i)?;
let (i, names) = separated_list0(tuple((space0, char(','), space0)), parse_string)(i)?;
let (i, _) = tuple((space0, line_ending))(i)?;
let (i, edges) = parse_edges(i)?;
Ok((
i,
SolveNameConflict {
path,
pos,
names,
edges,
},
))
let parse = |i, path| -> IResult<&str, PrintableHunk> {
let (i, pos) = preceded(space0, parse_printable_pos)(i)?;
let (i, _) = tuple((space0, char(':'), space0))(i)?;
let (i, names) = separated_list0(tuple((space0, char(','), space0)), parse_string)(i)?;
let (i, _) = tuple((space0, line_ending))(i)?;
let (i, edges) = parse_edges(i)?;
Ok((
i,
SolveNameConflict {
path,
pos,
names,
edges,
},
))
};
parse(i, path)
.map_err(|_| nom::Err::Error(nom::error::Error::new(i, nom::error::ErrorKind::Verify)))
let (i, pos) = preceded(space0, parse_printable_pos)(i)?;
let (i, _) = tuple((space0, char(':'), space0))(i)?;
let (i, names) = separated_list0(tuple((space0, char(','), space0)), parse_string)(i)?;
let (i, _) = tuple((space0, line_ending))(i)?;
let (i, edges) = parse_edges(i)?;
Ok((
i,
UnsolveNameConflict {
path,
pos,
names,
edges,
},
))
let parse = |i, path| -> IResult<&str, PrintableHunk> {
let (i, pos) = preceded(space0, parse_printable_pos)(i)?;
let (i, _) = tuple((space0, char(':'), space0))(i)?;
let (i, names) = separated_list0(tuple((space0, char(','), space0)), parse_string)(i)?;
let (i, _) = tuple((space0, line_ending))(i)?;
let (i, edges) = parse_edges(i)?;
Ok((
i,
UnsolveNameConflict {
path,
pos,
names,
edges,
},
))
};
parse(i, path)
.map_err(|_| nom::Err::Error(nom::error::Error::new(i, nom::error::ErrorKind::Verify)))
let (i, line) = preceded(char(':'), u64)(i)?;
let (i, pos) = preceded(space1, parse_printable_pos)(i)?;
let (i, encoding) = preceded(space0, parse_encoding)(i)?;
let (i, _) = tuple((space0, line_ending))(i)?;
let (i, change) = parse_new_vertex(i)?;
let (i, contents) = parse_contents('+', encoding.clone(), i)?;
Ok((
i,
SolveOrderConflict {
path,
line: line as usize,
pos,
encoding,
change,
contents,
},
))
let parse = |i, path| -> IResult<&str, PrintableHunk> {
let (i, line) = preceded(char(':'), u64)(i)?;
let (i, pos) = preceded(space1, parse_printable_pos)(i)?;
let (i, encoding) = preceded(space0, parse_encoding)(i)?;
let (i, _) = tuple((space0, line_ending))(i)?;
let (i, change) = parse_new_vertex(i)?;
let (i, contents) = parse_contents('+', encoding.clone(), i)?;
Ok((
i,
SolveOrderConflict {
path,
line: line as usize,
pos,
encoding,
change,
contents,
},
))
};
parse(i, path)
.map_err(|_| nom::Err::Error(nom::error::Error::new(i, nom::error::ErrorKind::Verify)))
let (i, line) = preceded(char(':'), u64)(i)?;
let (i, pos) = preceded(space1, parse_printable_pos)(i)?;
let (i, encoding) = preceded(space0, parse_encoding)(i)?;
let (i, _) = tuple((space0, line_ending))(i)?;
let (i, change) = parse_edges(i)?;
let (i, contents) = parse_contents('-', encoding.clone(), i)?;
Ok((
i,
UnsolveOrderConflict {
path,
line: line as usize,
pos,
encoding,
change,
contents,
},
))
let parse = |i, path| -> IResult<&str, PrintableHunk> {
let (i, line) = preceded(char(':'), u64)(i)?;
let (i, pos) = preceded(space1, parse_printable_pos)(i)?;
let (i, encoding) = preceded(space0, parse_encoding)(i)?;
let (i, _) = tuple((space0, line_ending))(i)?;
let (i, change) = parse_edges(i)?;
let (i, contents) = parse_contents('-', encoding.clone(), i)?;
Ok((
i,
UnsolveOrderConflict {
path,
line: line as usize,
pos,
encoding,
change,
contents,
},
))
};
parse(i, path)
.map_err(|_| nom::Err::Error(nom::error::Error::new(i, nom::error::ErrorKind::Verify)))
let (i, line) = preceded(char(':'), u64)(i)?;
let (i, pos) = preceded(space0, parse_printable_pos)(i)?;
let (i, encoding) = preceded(space0, parse_encoding)(i)?;
let (i, _) = tuple((space0, line_ending))(i)?;
let (i, change) = parse_edges(i)?;
let (i, contents) = parse_contents('+', encoding.clone(), i)?;
Ok((
i,
ResurrectZombies {
path,
line: line as usize,
pos,
encoding,
change,
contents,
},
))
let parse = |i, path| -> IResult<&str, PrintableHunk> {
let (i, line) = preceded(char(':'), u64)(i)?;
let (i, pos) = preceded(space0, parse_printable_pos)(i)?;
let (i, encoding) = preceded(space0, parse_encoding)(i)?;
let (i, _) = tuple((space0, line_ending))(i)?;
let (i, change) = parse_edges(i)?;
let (i, contents) = parse_contents('+', encoding.clone(), i)?;
Ok((
i,
ResurrectZombies {
path,
line: line as usize,
pos,
encoding,
change,
contents,
},
))
};
parse(i, path)
.map_err(|_| nom::Err::Error(nom::error::Error::new(i, nom::error::ErrorKind::Verify)))
let (i, _) = tuple((space0, line_ending, multispace0))(i)?;
debug!("root add {:?}", i);
let (i, up_context) = preceded(tag("up"), parse_context)(i)?;
debug!("root add {:?}", i);
let (i, (start, end)) = delimited(space0, parse_start_end, pair(space0, line_ending))(i)?;
debug!("root add {:?}", i);
assert_eq!(&up_context[..], &[PrintablePos(1, 0)]);
assert_eq!(start, end);
Ok((i, PrintableHunk::AddRoot { start }))
let parse = |i| -> IResult<&str, PrintableHunk> {
let (i, _) = tuple((space0, line_ending, multispace0))(i)?;
debug!("root add {:?}", i);
let (i, up_context) = preceded(tag("up"), parse_context)(i)?;
debug!("root add {:?}", i);
let (i, (start, end)) = delimited(space0, parse_start_end, pair(space0, line_ending))(i)?;
debug!("root add {:?}", i);
assert_eq!(&up_context[..], &[PrintablePos(1, 0)]);
assert_eq!(start, end);
Ok((i, PrintableHunk::AddRoot { start }))
};
parse(i)
.map_err(|_| nom::Err::Error(nom::error::Error::new(i, nom::error::ErrorKind::Verify)))
let (i, _) = tuple((space0, line_ending))(i)?;
let (i, name) = parse_edges(i)?;
let (i, inode) = parse_edges(i)?;
let parse = |i| -> IResult<&str, PrintableHunk> {
let (i, _) = tuple((space0, line_ending))(i)?;
let (i, name) = parse_edges(i)?;
let (i, inode) = parse_edges(i)?;