##// END OF EJS Templates
copies: handle a case when both merging csets are not descendant of merge base...
copies: handle a case when both merging csets are not descendant of merge base This patch fix the behaviour of fullcopytracing algorithm in the case when both the merging csets are not the descendant of merge base. Although it seems to be the rare case when both the csets are not descendant of merge base. But it can be seen in most of cases of content-divergence in evolve extension, where merge base is the common predecessor. Previous patch added a test where this algorithm can fail to continue because of an assumption that only one of the two csets can be dirty. This patch fix that error. For refrence I suggest you to look into the previous discussion held on a patch sent by Pulkit: https://phab.mercurial-scm.org/D3896 Differential Revision: https://phab.mercurial-scm.org/D5963

File last commit:

r38192:36d55f90 default
r42098:7694b685 default
Show More
fuzzutil.h
47 lines | 1.2 KiB | text/x-c | CLexer
#ifndef CONTRIB_FUZZ_FUZZUTIL_H
#define CONTRIB_FUZZ_FUZZUTIL_H
#include <iostream>
#include <memory>
#include <stdint.h>
/* Try and use std::optional, but failing that assume we'll have a
* workable https://abseil.io/ install on the include path to get
* their backport of std::optional. */
#ifdef __has_include
#if __has_include(<optional>) && __cplusplus >= 201703L
#include <optional>
#define CONTRIB_FUZZ_HAVE_STD_OPTIONAL
#endif
#endif
#ifdef CONTRIB_FUZZ_HAVE_STD_OPTIONAL
namespace contrib
{
using std::nullopt;
using std::optional;
} /* namespace contrib */
#else
#include "third_party/absl/types/optional.h"
namespace contrib
{
using absl::nullopt;
using absl::optional;
} /* namespace contrib */
#endif
/* set DEBUG to 1 for a few debugging prints, or 2 for a lot */
#define DEBUG 0
#define LOG(level) \
if (level <= DEBUG) \
std::cout
struct two_inputs {
std::unique_ptr<char[]> right;
size_t right_size;
std::unique_ptr<char[]> left;
size_t left_size;
};
/* Split a non-zero-length input into two inputs. */
contrib::optional<two_inputs> SplitInputs(const uint8_t *Data, size_t Size);
#endif /* CONTRIB_FUZZ_FUZZUTIL_H */