D2684: xdiff: remove unused structure, functions, and constants
quark (Jun Wu)
phabricator at mercurial-scm.org
Tue Mar 6 22:12:14 EST 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGb5bb0f99064d: xdiff: remove unused structure, functions, and constants (authored by quark, committed by ).
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D2684?vs=6682&id=6686
REVISION DETAIL
https://phab.mercurial-scm.org/D2684
AFFECTED FILES
mercurial/cext/bdiff.c
mercurial/thirdparty/xdiff/xdiff.h
mercurial/thirdparty/xdiff/xdiffi.h
mercurial/thirdparty/xdiff/xutils.c
mercurial/thirdparty/xdiff/xutils.h
CHANGE DETAILS
diff --git a/mercurial/thirdparty/xdiff/xutils.h b/mercurial/thirdparty/xdiff/xutils.h
--- a/mercurial/thirdparty/xdiff/xutils.h
+++ b/mercurial/thirdparty/xdiff/xutils.h
@@ -38,8 +38,6 @@
int xdl_num_out(char *out, long val);
int xdl_emit_hunk_hdr(long s1, long c1, long s2, long c2,
const char *func, long funclen, xdemitcb_t *ecb);
-int xdl_fall_back_diff(xdfenv_t *diff_env, xpparam_t const *xpp,
- int line1, int count1, int line2, int count2);
diff --git a/mercurial/thirdparty/xdiff/xutils.c b/mercurial/thirdparty/xdiff/xutils.c
--- a/mercurial/thirdparty/xdiff/xutils.c
+++ b/mercurial/thirdparty/xdiff/xutils.c
@@ -241,34 +241,3 @@
return 0;
}
-
-int xdl_fall_back_diff(xdfenv_t *diff_env, xpparam_t const *xpp,
- int line1, int count1, int line2, int count2)
-{
- /*
- * This probably does not work outside Git, since
- * we have a very simple mmfile structure.
- *
- * Note: ideally, we would reuse the prepared environment, but
- * the libxdiff interface does not (yet) allow for diffing only
- * ranges of lines instead of the whole files.
- */
- mmfile_t subfile1, subfile2;
- xdfenv_t env;
-
- subfile1.ptr = (char *)diff_env->xdf1.recs[line1 - 1]->ptr;
- subfile1.size = diff_env->xdf1.recs[line1 + count1 - 2]->ptr +
- diff_env->xdf1.recs[line1 + count1 - 2]->size - subfile1.ptr;
- subfile2.ptr = (char *)diff_env->xdf2.recs[line2 - 1]->ptr;
- subfile2.size = diff_env->xdf2.recs[line2 + count2 - 2]->ptr +
- diff_env->xdf2.recs[line2 + count2 - 2]->size - subfile2.ptr;
- if (xdl_do_diff(&subfile1, &subfile2, xpp, &env) < 0)
- return -1;
-
- memcpy(diff_env->xdf1.rchg + line1 - 1, env.xdf1.rchg, count1);
- memcpy(diff_env->xdf2.rchg + line2 - 1, env.xdf2.rchg, count2);
-
- xdl_free_env(&env);
-
- return 0;
-}
diff --git a/mercurial/thirdparty/xdiff/xdiffi.h b/mercurial/thirdparty/xdiff/xdiffi.h
--- a/mercurial/thirdparty/xdiff/xdiffi.h
+++ b/mercurial/thirdparty/xdiff/xdiffi.h
@@ -56,9 +56,5 @@
void xdl_free_script(xdchange_t *xscr);
int xdl_emit_diff(xdfenv_t *xe, xdchange_t *xscr, xdemitcb_t *ecb,
xdemitconf_t const *xecfg);
-int xdl_do_patience_diff(mmfile_t *mf1, mmfile_t *mf2, xpparam_t const *xpp,
- xdfenv_t *env);
-int xdl_do_histogram_diff(mmfile_t *mf1, mmfile_t *mf2, xpparam_t const *xpp,
- xdfenv_t *env);
#endif /* #if !defined(XDIFFI_H) */
diff --git a/mercurial/thirdparty/xdiff/xdiff.h b/mercurial/thirdparty/xdiff/xdiff.h
--- a/mercurial/thirdparty/xdiff/xdiff.h
+++ b/mercurial/thirdparty/xdiff/xdiff.h
@@ -41,14 +41,6 @@
* (a1, a2 - a1, b1, b2 - b1) hunks */
#define XDL_EMIT_BDIFFHUNK (1 << 4)
-#define XDL_MMB_READONLY (1 << 0)
-
-#define XDL_MMF_ATOMIC (1 << 0)
-
-#define XDL_BDOP_INS 1
-#define XDL_BDOP_CPY 2
-#define XDL_BDOP_INSB 3
-
/* merge simplification levels */
#define XDL_MERGE_MINIMAL 0
#define XDL_MERGE_EAGER 1
@@ -75,10 +67,6 @@
typedef struct s_xpparam {
unsigned long flags;
-
- /* See Documentation/diff-options.txt. */
- char **anchors;
- size_t anchors_nr;
} xpparam_t;
typedef struct s_xdemitcb {
@@ -101,10 +89,6 @@
xdl_emit_hunk_consume_func_t hunk_func;
} xdemitconf_t;
-typedef struct s_bdiffparam {
- long bsize;
-} bdiffparam_t;
-
#define xdl_malloc(x) malloc(x)
#define xdl_free(ptr) free(ptr)
diff --git a/mercurial/cext/bdiff.c b/mercurial/cext/bdiff.c
--- a/mercurial/cext/bdiff.c
+++ b/mercurial/cext/bdiff.c
@@ -278,8 +278,6 @@
xpparam_t xpp = {
XDF_INDENT_HEURISTIC, /* flags */
- NULL, /* anchors */
- 0, /* anchors_nr */
};
xdemitconf_t xecfg = {
0, /* ctxlen */
To: quark, #hg-reviewers, indygreg
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list