##// END OF EJS Templates
copies: compute the exact set of revision to walk...
copies: compute the exact set of revision to walk This change make the code clearer by removing the revision queue. It comes without very noticeable performance impact. However the simpler code will be easier to update in later changesets. revision: large amount; added files: large amount; rename small amount; c3b14617fbd7 9ba6ab77fd29 before: ! wall 1.430082 comb 1.430000 user 1.390000 sys 0.040000 (median of 10) after: ! wall 1.405192 comb 1.410000 user 1.390000 sys 0.020000 (median of 10) revision: large amount; added files: small amount; rename small amount; c3b14617fbd7 f650a9b140d2 before: ! wall 1.971366 comb 1.970000 user 1.950000 sys 0.020000 (median of 10) after: ! wall 1.892541 comb 1.890000 user 1.870000 sys 0.020000 (median of 10) revision: large amount; added files: large amount; rename large amount; 08ea3258278e d9fa043f30c0 before: ! wall 0.252594 comb 0.250000 user 0.240000 sys 0.010000 (median of 38) after: ! wall 0.240075 comb 0.240000 user 0.240000 sys 0.000000 (median of 40) revision: small amount; added files: large amount; rename large amount; df6f7a526b60 a83dc6a2d56f before: ! wall 0.013100 comb 0.010000 user 0.010000 sys 0.000000 (median of 226) after: ! wall 0.013247 comb 0.010000 user 0.010000 sys 0.000000 (median of 223) revision: small amount; added files: large amount; rename small amount; 4aa4e1f8e19a 169138063d63 before: ! wall 0.001633 comb 0.000000 user 0.000000 sys 0.000000 (median of 1000) after: ! wall 0.001670 comb 0.000000 user 0.000000 sys 0.000000 (median of 1000) revision: small amount; added files: small amount; rename small amount; 4bc173b045a6 964879152e2e before: ! wall 0.000078 comb 0.000000 user 0.000000 sys 0.000000 (median of 11984) after: ! wall 0.000119 comb 0.000000 user 0.000000 sys 0.000000 (median of 7982) revision: medium amount; added files: large amount; rename medium amount; c95f1ced15f2 2c68e87c3efe before: ! wall 0.207093 comb 0.210000 user 0.210000 sys 0.000000 (median of 47) after: ! wall 0.201551 comb 0.200000 user 0.200000 sys 0.000000 (median of 48) revision: medium amount; added files: medium amount; rename small amount; d343da0c55a8 d7746d32bf9d before: ! wall 0.038462 comb 0.040000 user 0.040000 sys 0.000000 (median of 100) after: ! wall 0.036578 comb 0.030000 user 0.030000 sys 0.000000 (median of 100) Differential Revision: https://phab.mercurial-scm.org/D7076

File last commit:

r36782:3cf40112 default
r43593:83bb1e89 default
Show More
xdiff.h
91 lines | 2.3 KiB | text/x-c | CLexer
/*
* LibXDiff by Davide Libenzi ( File Differential Library )
* Copyright (C) 2003 Davide Libenzi
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see
* <http://www.gnu.org/licenses/>.
*
* Davide Libenzi <davidel@xmailserver.org>
*
*/
#if !defined(XDIFF_H)
#define XDIFF_H
#ifdef __cplusplus
extern "C" {
#endif /* #ifdef __cplusplus */
#include <stddef.h> /* size_t */
#if !defined(_MSC_VER) || _MSC_VER >= 1600
#include <stdint.h>
#else
/* prior to Visual Studio 2010 */
typedef long long int64_t;
typedef unsigned long long uint64_t;
#endif
/* xpparm_t.flags */
#define XDF_NEED_MINIMAL (1 << 0)
#define XDF_INDENT_HEURISTIC (1 << 23)
/* emit bdiff-style "matched" (a1, a2, b1, b2) hunks instead of "different"
* (a1, a2 - a1, b1, b2 - b1) hunks */
#define XDL_EMIT_BDIFFHUNK (1 << 4)
typedef struct s_mmfile {
char *ptr;
int64_t size;
} mmfile_t;
typedef struct s_mmbuffer {
char *ptr;
int64_t size;
} mmbuffer_t;
typedef struct s_xpparam {
uint64_t flags;
} xpparam_t;
typedef struct s_xdemitcb {
void *priv;
} xdemitcb_t;
typedef int (*xdl_emit_hunk_consume_func_t)(int64_t start_a, int64_t count_a,
int64_t start_b, int64_t count_b,
void *cb_data);
typedef struct s_xdemitconf {
uint64_t flags;
xdl_emit_hunk_consume_func_t hunk_func;
} xdemitconf_t;
#define xdl_malloc(x) malloc(x)
#define xdl_free(ptr) free(ptr)
#define xdl_realloc(ptr,x) realloc(ptr,x)
void *xdl_mmfile_first(mmfile_t *mmf, int64_t *size);
int64_t xdl_mmfile_size(mmfile_t *mmf);
int xdl_diff(mmfile_t *mf1, mmfile_t *mf2, xpparam_t const *xpp,
xdemitconf_t const *xecfg, xdemitcb_t *ecb);
#ifdef __cplusplus
}
#endif /* #ifdef __cplusplus */
#endif /* #if !defined(XDIFF_H) */