change: decode FILE_ADD
Dependencies
- [2]
N3PUHKQNchange: fix scoping issue - [3]
YDQLW2ZOchange: rework printing of patches - print Edit and Newvertex types - [4]
XTVLIC24change: refactor to print_change() - [5]
NZNIG2ULFix lots of warnings, adjust build flags - [6]
QLH63JBHchange: replace calls to abort() with die() - [*]
Q7TKZCJPAdd initial support for reading the offsets from a (fixed) change - [*]
JAGXXSR7change: initial work on decoding hunks - [*]
FMYCPGKDchange: extract hash list decoding into reused function - [*]
RIWSVVASchange: decompress the 'contents' with zstd_seekable
Change contents
- edit in change.c at line 323
break;case FILE_ADD:change_decode_atom(binstat, &bhunk->fileadd.addname);change_decode_atom(binstat, &bhunk->fileadd.addinode);if (bincode_getu8(binstat))change_decode_atom(binstat, &bhunk->fileadd.contents);slen = bincode_getu64(binstat);bhunk->fileadd.path = bincode_getstr(binstat, slen);change_decode_encoding(binstat, &bhunk->edit.encoding); - edit in change.c at line 482[11.2595][11.2595]
voidprint_edgeflags(uint8_t flags){if (flags & EDGE_FLAG_BLOCK)printf("B");if (flags & EDGE_FLAG_FOLDER)printf("F");if (flags & EDGE_FLAG_DELETED)printf("D");} - replacement in change.c at line 534
printf("EdgeMap... \n");printf("edgemap {\n edges: [\n");for (i = 0; i < m->edges.len; i++) {struct edge *e = &m->edges.entries[i];printf(" edge { previous = %u, flag = ",e->previous);print_edgeflags(e->flag);printf(", from = Position { .. }, to = vertex { .. }, introducedby = ");hashprint(&e->introducedby);printf(" }\n");}printf(" ]\n}\n"); - edit in change.c at line 621
case FILE_ADD: {struct fileadd *f = &hunk->fileadd;printf(" %s (%s)", f->path, f->encoding);printf("\n");/* FIXME: f->contents is optional, how should we indicate this? */print_atom(&f->contents, contents);break;}