mercurial/bdiff.h
author Adam Simpkins <simpkins@fb.com>
Tue, 27 Jun 2017 16:15:32 -0700
changeset 33114 8b20338b989e
parent 29541 9631ff5ebbeb
child 34627 72985b390d7c
permissions -rw-r--r--
setup: prefer using the system hg to interact with the local repository Add a findhg() function that tries to be smarter about figuring out how to run hg for examining the local repository. It first tries running "hg" from the user's PATH, with the default HGRCPATH settings intact, but with HGPLAIN enabled. This will generally use the same version of mercurial and the same settings used to originally clone the repository, and should have a higher chance of working successfully than trying to run the hg script from the local repository. If that fails findhg() falls back to the existing behavior of running the local hg script.

#ifndef _HG_BDIFF_H_
#define _HG_BDIFF_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