change: refactor to print_change()
Dependencies
- [2]
ZKAOPMCHchange: Implement decoding of edits, atoms, positions, among others - [3]
YDQLW2ZOchange: rework printing of patches - print Edit and Newvertex types - [4]
RIWSVVASchange: decompress the 'contents' with zstd_seekable - [5]
CJEOFJ27change: minor output adjustment - [6]
KDJUAAALchange: prefix function names with change_ - [7]
QYRJIOYPchange: separate decoding and printing of hashed struct - [8]
OBKF6SIIchange: decompress the hashed section too - [9]
QEFCNNVCchange: display offsets for given change file - [10]
XTKRT6OQformat the codebase - [11]
Q7TKZCJPAdd initial support for reading the offsets from a (fixed) change - [12]
JAGXXSR7change: initial work on decoding hunks - [13]
KEC3WLFNchange: remove debugging lines - [14]
2U7P5SFQChange struct names "struct foo -> typedef struct Foo" - [*]
YG4DZB3Aadd representation of hash, decode dependencies
Change contents
- replacement in hunk.c at line 42
abort();abort(); // FIXME Replace with die() - edit in hash.h at line 21[4.604][16.320]
void hashlist_free(Hashlist *h); - edit in hash.c at line 34[16.699][16.699]
}voidhashlist_free(Hashlist *h){free(h->entries); - edit in change.c at line 357
/* printf("%d. %s\n", i + 1, hunk_basehunk_type_str(bhunk->hunktype)); */ - replacement in change.c at line 526
* TODO To properly print EDGE_MAP types we need access to referenced changes to pull deleted lines* TODO To properly print EDGE_MAP types we need access to referenced changes to* pull deleted lines. - replacement in change.c at line 534
char *c, x;char x; - edit in change.c at line 569
}}voidprint_change(Hashed *hashed, uint8_t *contents){int i;printf("message = %s\n", hashed->header.message);if (hashed->header.description)printf("description = '%s'\n", hashed->header.description);printf("timestamp = '%s'\n\n", hashed->header.timestamp);printf("[[authors]]\n");for (i = 0; i < hashed->header.authors.len; i++) {int j;for (j = 0; j < hashed->header.authors.map[i].len; j++) {printf("%s = '%s'\n",hashed->header.authors.map[i].entries[j].key,hashed->header.authors.map[i].entries[j].value);}}printf("\n");printf("# Dependencies\n");for (i = 0; i < hashed->dependencies.len; i++) {printf(" ");hashprintln(&hashed->dependencies.entries[i]);}for (i = 0; i < hashed->extraknown.len; i++) {printf("+");hashprintln(&hashed->extraknown.entries[i]);}printf("\n#Hunks\n\n");/* FIXME: Put all the hashes of dependencies in a big list, and number them from 2 */for (i = 0; i < hashed->hunks.len; i++) {Basehunk *hunk = &hashed->hunks.entries[i];printf("%d. %s", i + 1, hunk_basehunk_type_str(hunk->hunktype));switch (hunk->hunktype) {case EDIT:Edit *e = &hunk->edit;Atom *c = &e->change;printf(" in %s:%u (%s)", e->local.path, e->local.line,e->encoding);printf("\n");print_atom(c, contents);break;case REPLACEMENT:Replacement *r = &hunk->replacement;printf(" in %s:%u (%s)", r->local.path, r->local.line,r->encoding);print_atom(c, contents);printf("\n");break;default:printf(" [not yet implemented]\n");break;} - edit in change.c at line 632
- replacement in change.c at line 693
printf("message = %s\n", hashed.header.message);if (hashed.header.description)printf("description = '%s'\n", hashed.header.description);printf("timestamp = '%s'\n\n", hashed.header.timestamp);print_change(&hashed, contents); - edit in change.c at line 695[4.1675]→[4.1675:1962](∅→∅),[4.1962]→[4.2584:2587](∅→∅),[4.2584]→[4.2584:2587](∅→∅),[4.2587]→[4.1963:1978](∅→∅),[4.1978]→[4.2621:2622](∅→∅),[4.2587]→[4.2621:2622](∅→∅),[4.2622]→[4.1979:2072](∅→∅),[4.2072]→[2.5675:5723](∅→∅),[4.3391]→[4.2119:2122](∅→∅),[2.5723]→[4.2119:2122](∅→∅),[4.2119]→[4.2119:2122](∅→∅),[4.2122]→[4.3392:3439](∅→∅),[4.3439]→[4.2170:2185](∅→∅),[4.2170]→[4.2170:2185](∅→∅),[4.2185]→[2.5724:5770](∅→∅),[4.3484]→[4.2231:2234](∅→∅),[2.5770]→[4.2231:2234](∅→∅),[4.2231]→[4.2231:2234](∅→∅),[4.2234]→[3.1314:1339](∅→∅),[3.1339]→[4.2249:2250](∅→∅),[4.2249]→[4.2249:2250](∅→∅),[4.2250]→[3.1340:2045](∅→∅),[3.2045]→[4.2866:2870](∅→∅),[4.2866]→[4.2866:2870](∅→∅)
printf("[[authors]]\n");for (i = 0; i < hashed.header.authors.len; i++) {int j;for (j = 0; j < hashed.header.authors.map[i].len; j++) {printf("%s = '%s'\n",hashed.header.authors.map[i].entries[j].key,hashed.header.authors.map[i].entries[j].value);}}printf("\n");printf("# Dependencies\n");for (i = 0; i < hashed.dependencies.len; i++) {printf(" ");hashprintln(&hashed.dependencies.entries[i]);}for (i = 0; i < hashed.extraknown.len; i++) {printf("+");hashprintln(&hashed.extraknown.entries[i]);}printf("\n#Hunks\n\n");/* FIXME: Put all the hashes of dependencies in a big list, and number them from 2 */for (i = 0; i < hashed.hunks.len; i++) {Basehunk *hunk = &hashed.hunks.entries[i];printf("%d. %s", i + 1, hunk_basehunk_type_str(hunk->hunktype));switch (hunk->hunktype) {case EDIT:Edit *e = &hunk->edit;Atom *c = &e->change;printf(" in %s:%u (%s)", e->local.path, e->local.line,e->encoding);printf("\n");print_atom(c, contents);break;case REPLACEMENT:Replacement *r = &hunk->replacement;printf(" in %s:%u (%s)", r->local.path, r->local.line,r->encoding);printf("\n");break;default:printf(" [not yet implemented]\n");break;}}