change: add vertexeq, fix deleted lines duplication

laumann
Jul 13, 2023, 11:46 AM
EHVLRMEF6YK5FRIV5V7V6P5RHJPCYKMSW5OVKDXLUEWHEM624FBAC

Dependencies

  • [2] SADDDVGO makefile: add target to generate TAGS file
  • [3] 5D2IYPL7 change: introduce changestore, print deleted lines
  • [4] YDQLW2ZO change: rework printing of patches - print Edit and Newvertex types
  • [*] JAGXXSR7 change: initial work on decoding hunks
  • [*] JVU3TTT5 all: switch away from typedefing anonymous structs
  • [*] PEUS54XQ
  • [*] XJ2PEH74 add meson.build
  • [*] L3HKOF4W wrap vendored zstd seekable in own file, #2
  • [*] YG4DZB3A add representation of hash, decode dependencies
  • [*] Q7TKZCJP Add initial support for reading the offsets from a (fixed) change
  • [*] B3XLVPNC Add ani.c and initial Makefile
  • [*] NETL2N53 Makefile: add check target

Change contents

  • edit in vertex.h at line 40
    [7.246]
    [6.624]
    int vertexeq(struct vertex *v1, struct vertex *v2);
  • file addition: vertex.c (----------)
    [8.1]
    #include <stdint.h>
    #include <stddef.h>
    #include "common.h"
    #include "hash.h"
    #include "vertex.h"
    int
    vertexeq(struct vertex *v1, struct vertex *v2)
    {
    return hasheq(&v1->change, &v2->change) && v1->start == v2->start &&
    v1->end == v2->end;
    }
  • edit in meson.build at line 30
    [9.346]
    [10.1399]
    'vertex.c',
  • edit in hash.c at line 38
    [3.739]
    [3.739]
    /* Return 1 if hashes are equal, 0 otherwise */
  • edit in change.c at line 568
    [3.2157]
    [3.2157]
    struct vertex *vto = NULL;
  • replacement in change.c at line 590
    [3.2651][3.2651:2953]()
    // FIXME: need to keep track of current! see
    // /home/t/sources/pijul/pijul/libpijul/src/changestore/filesystem.rs (get_contents_ext)
    size_t z = edge->to.end - edge->to.start;
    /* TODO loop over the edges, extract relevant contents from the changestore */
    // keep track of current vertex
    [3.2651]
    [3.2953]
    if (vto && vertexeq(&edge->to, vto))
    continue;
    vto = &edge->to;
    size_t z = vto->end - vto->start;
  • replacement in change.c at line 595
    [3.2954][3.2954:3153]()
    ch = changestoreget(changes, &edge->to.change);
    /* printf("changestoreget("); */
    /* hashprint(&edge->to.change); */
    /* printf(")"); */
    /* printf(" - %s\n", ch ? "ok" : "fail :-("); */
    [3.2954]
    [3.3153]
    ch = changestoreget(changes, &vto->change);
  • replacement in change.c at line 602
    [3.3345][3.3345:3360]()
    if (buf) {
    [3.3345]
    [3.3360]
    if (buf)
  • replacement in change.c at line 606
    [3.3425][3.3425:3438]()
    } else {
    [3.3425]
    [3.3438]
    else
  • replacement in change.c at line 608
    [3.3479][3.3479:3552]()
    }
    memcpy(&buf[sz], &ch->contents[edge->to.start],
    z);
    [3.3479]
    [3.3552]
    memcpy(&buf[sz], &ch->contents[vto->start], z);
  • replacement in change.c at line 714
    [3.5033][3.5033:5044]()
    if (res)
    [3.5033]
    [3.5044]
    if (res) {
  • edit in change.c at line 716
    [3.5075]
    [4.962]
    free(res);
    }
  • edit in Makefile at line 53
    [14.82]
    [2.13]
    check2: build
    build/ani change YM2LC6QP2D7TK3JUKOXWUWTQEGMCEGQDGPTOZPWC3BRDFNRKSZWQC # this one has file additions