mercurial/thirdparty/xdiff/xutils.h
author Matt Harbison <matt_harbison@yahoo.com>
Wed, 09 Jan 2019 16:02:05 -0500
changeset 41180 69804c040a04
parent 36825 f1ef0e53e628
permissions -rw-r--r--
convert: don't drop commits that are empty in the source when using --filemap I ran into this when using `hg lfconvert --to-normal` (which uses the filemap class internally), and saw that commits with nothing but a branch change were dropped. We could put in an option that only lfconvert uses internally. But silently dropping anything other than a commit where all changes were excluded seems unintended. For example, there's a message in mercurial_sink.putcommit() if it drops an empty commit. (And the reason that isn't kicking in here is because lfconvert isn't passing --filemap, so the self.filemapmode conditional there is always False.) The naive change of `return not files` broke test-convert-filemap.t, so this is a little more elaborate than needed for converting from largefiles.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
36671
34e2ff1f9cd8 xdiff: vendor xdiff library from git
Jun Wu <quark@fb.com>
parents:
diff changeset
     1
/*
34e2ff1f9cd8 xdiff: vendor xdiff library from git
Jun Wu <quark@fb.com>
parents:
diff changeset
     2
 *  LibXDiff by Davide Libenzi ( File Differential Library )
34e2ff1f9cd8 xdiff: vendor xdiff library from git
Jun Wu <quark@fb.com>
parents:
diff changeset
     3
 *  Copyright (C) 2003  Davide Libenzi
34e2ff1f9cd8 xdiff: vendor xdiff library from git
Jun Wu <quark@fb.com>
parents:
diff changeset
     4
 *
34e2ff1f9cd8 xdiff: vendor xdiff library from git
Jun Wu <quark@fb.com>
parents:
diff changeset
     5
 *  This library is free software; you can redistribute it and/or
34e2ff1f9cd8 xdiff: vendor xdiff library from git
Jun Wu <quark@fb.com>
parents:
diff changeset
     6
 *  modify it under the terms of the GNU Lesser General Public
34e2ff1f9cd8 xdiff: vendor xdiff library from git
Jun Wu <quark@fb.com>
parents:
diff changeset
     7
 *  License as published by the Free Software Foundation; either
34e2ff1f9cd8 xdiff: vendor xdiff library from git
Jun Wu <quark@fb.com>
parents:
diff changeset
     8
 *  version 2.1 of the License, or (at your option) any later version.
34e2ff1f9cd8 xdiff: vendor xdiff library from git
Jun Wu <quark@fb.com>
parents:
diff changeset
     9
 *
34e2ff1f9cd8 xdiff: vendor xdiff library from git
Jun Wu <quark@fb.com>
parents:
diff changeset
    10
 *  This library is distributed in the hope that it will be useful,
34e2ff1f9cd8 xdiff: vendor xdiff library from git
Jun Wu <quark@fb.com>
parents:
diff changeset
    11
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
34e2ff1f9cd8 xdiff: vendor xdiff library from git
Jun Wu <quark@fb.com>
parents:
diff changeset
    12
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
34e2ff1f9cd8 xdiff: vendor xdiff library from git
Jun Wu <quark@fb.com>
parents:
diff changeset
    13
 *  Lesser General Public License for more details.
34e2ff1f9cd8 xdiff: vendor xdiff library from git
Jun Wu <quark@fb.com>
parents:
diff changeset
    14
 *
34e2ff1f9cd8 xdiff: vendor xdiff library from git
Jun Wu <quark@fb.com>
parents:
diff changeset
    15
 *  You should have received a copy of the GNU Lesser General Public
34e2ff1f9cd8 xdiff: vendor xdiff library from git
Jun Wu <quark@fb.com>
parents:
diff changeset
    16
 *  License along with this library; if not, see
34e2ff1f9cd8 xdiff: vendor xdiff library from git
Jun Wu <quark@fb.com>
parents:
diff changeset
    17
 *  <http://www.gnu.org/licenses/>.
34e2ff1f9cd8 xdiff: vendor xdiff library from git
Jun Wu <quark@fb.com>
parents:
diff changeset
    18
 *
34e2ff1f9cd8 xdiff: vendor xdiff library from git
Jun Wu <quark@fb.com>
parents:
diff changeset
    19
 *  Davide Libenzi <davidel@xmailserver.org>
34e2ff1f9cd8 xdiff: vendor xdiff library from git
Jun Wu <quark@fb.com>
parents:
diff changeset
    20
 *
34e2ff1f9cd8 xdiff: vendor xdiff library from git
Jun Wu <quark@fb.com>
parents:
diff changeset
    21
 */
34e2ff1f9cd8 xdiff: vendor xdiff library from git
Jun Wu <quark@fb.com>
parents:
diff changeset
    22
34e2ff1f9cd8 xdiff: vendor xdiff library from git
Jun Wu <quark@fb.com>
parents:
diff changeset
    23
#if !defined(XUTILS_H)
34e2ff1f9cd8 xdiff: vendor xdiff library from git
Jun Wu <quark@fb.com>
parents:
diff changeset
    24
#define XUTILS_H
34e2ff1f9cd8 xdiff: vendor xdiff library from git
Jun Wu <quark@fb.com>
parents:
diff changeset
    25
34e2ff1f9cd8 xdiff: vendor xdiff library from git
Jun Wu <quark@fb.com>
parents:
diff changeset
    26
34e2ff1f9cd8 xdiff: vendor xdiff library from git
Jun Wu <quark@fb.com>
parents:
diff changeset
    27
36822
882657a9f768 xdiff: replace {unsigned ,}long with {u,}int64_t
Jun Wu <quark@fb.com>
parents: 36763
diff changeset
    28
int64_t xdl_bogosqrt(int64_t n);
882657a9f768 xdiff: replace {unsigned ,}long with {u,}int64_t
Jun Wu <quark@fb.com>
parents: 36763
diff changeset
    29
int xdl_cha_init(chastore_t *cha, int64_t isize, int64_t icount);
36671
34e2ff1f9cd8 xdiff: vendor xdiff library from git
Jun Wu <quark@fb.com>
parents:
diff changeset
    30
void xdl_cha_free(chastore_t *cha);
34e2ff1f9cd8 xdiff: vendor xdiff library from git
Jun Wu <quark@fb.com>
parents:
diff changeset
    31
void *xdl_cha_alloc(chastore_t *cha);
36822
882657a9f768 xdiff: replace {unsigned ,}long with {u,}int64_t
Jun Wu <quark@fb.com>
parents: 36763
diff changeset
    32
int64_t xdl_guess_lines(mmfile_t *mf, int64_t sample);
36823
49fe6249937a xdiff: remove unused flags parameter
Jun Wu <quark@fb.com>
parents: 36822
diff changeset
    33
int xdl_recmatch(const char *l1, int64_t s1, const char *l2, int64_t s2);
49fe6249937a xdiff: remove unused flags parameter
Jun Wu <quark@fb.com>
parents: 36822
diff changeset
    34
uint64_t xdl_hash_record(char const **data, char const *top);
36825
f1ef0e53e628 xdiff: use int64 for hash table size
Jun Wu <quark@fb.com>
parents: 36823
diff changeset
    35
unsigned int xdl_hashbits(int64_t size);
36671
34e2ff1f9cd8 xdiff: vendor xdiff library from git
Jun Wu <quark@fb.com>
parents:
diff changeset
    36
34e2ff1f9cd8 xdiff: vendor xdiff library from git
Jun Wu <quark@fb.com>
parents:
diff changeset
    37
34e2ff1f9cd8 xdiff: vendor xdiff library from git
Jun Wu <quark@fb.com>
parents:
diff changeset
    38
34e2ff1f9cd8 xdiff: vendor xdiff library from git
Jun Wu <quark@fb.com>
parents:
diff changeset
    39
#endif /* #if !defined(XUTILS_H) */