AmendHub

Download:

jcs

/

amend

/

amendments

/

250

repo+browser: Amendments are in order in array now

We're no longer putting newest amendments first, and after making
an amendment, it will be last in the list

jcs made amendment 250 about 1 year ago
--- browser.c Thu May 4 16:24:35 2023 +++ browser.c Thu May 4 17:36:29 2023 @@ -375,7 +375,7 @@ browser_filter_amendments(struct browser *browser) /* fill in amendments for selected files */ nselected_files = browser_selected_file_ids(browser, &selected_files); cell.v = 0; - for (i = 0; i < browser->repo->namendments; i++) { + for (i = browser->repo->namendments - 1; i >= 0; i--) { add = 0; amendment = browser->repo->amendments[i]; if (amendment == NULL) --- repo.c Thu May 4 17:08:07 2023 +++ repo.c Thu May 4 17:22:13 2023 @@ -191,8 +191,8 @@ repo_load_amendments(struct repo *repo, bool fill_in) if (size == 0) panic("failed fetching amendment %ld", ids[i]); - repo->amendments[repo->namendments - 1 - i] = - repo_parse_amendment(ids[i], (unsigned char *)data, size); + repo->amendments[i] = repo_parse_amendment(ids[i], + (unsigned char *)data, size); if (repo->amendments[i]->id >= repo->next_amendment_id) repo->next_amendment_id = repo->amendments[i]->id + 1; xfree(&data);