view mercurial/bdiff.h @ 35092:4fb489a998c9

run-tests: allow to register any arbitrary pattern for replacement We add a 'common-pattern.py' file that allow to define extra pattern. This seems a cleaner approach than editing the 'run-test.py' file over and over. In addition allowing arbitrary pattern registration will also help extension. The format used is a python file is picked out of convenience defining a list of tuple in 'substitutions' variable. This is picked out of convenience since it is dead simple to implement. The end goal is to register more pattern for Mercurial test. There are multiple common patterns that change over time. That impact is annoying. Using pattern emplacement for them would be handy. The next patches will define all the needed patterns and the last patch will mass-update the tests outputs as it was easier to do in a single pass.
author Boris Feld <boris.feld@octobus.net>
date Sun, 05 Nov 2017 06:34:27 +0100
parents 174d115d8104
children d86908050375
line wrap: on
line source

#ifndef _HG_BDIFF_H_
#define _HG_BDIFF_H_

#include "compat.h"

struct bdiff_line {
	int hash, n, e;
	ssize_t len;
	const char *l;
};

struct bdiff_hunk;
struct bdiff_hunk {
	int a1, a2, b1, b2;
	struct bdiff_hunk *next;
};

int bdiff_splitlines(const char *a, ssize_t len, struct bdiff_line **lr);
int bdiff_diff(struct bdiff_line *a, int an, struct bdiff_line *b, int bn,
               struct bdiff_hunk *base);
void bdiff_freehunks(struct bdiff_hunk *l);

#endif