diff --git a/cdatapack/cdatapack.h b/cdatapack/cdatapack.h --- a/cdatapack/cdatapack.h +++ b/cdatapack/cdatapack.h @@ -7,12 +7,12 @@ #ifndef CDATAPACK_CDATAPACK_H #define CDATAPACK_CDATAPACK_H -#include +#include #include -#include +#include #include -#include "portability/portability.h" +#include "clib/portability/portability.h" #define NODE_SZ 20 diff --git a/cdatapack/cdatapack.c b/cdatapack/cdatapack.c --- a/cdatapack/cdatapack.c +++ b/cdatapack/cdatapack.c @@ -4,6 +4,8 @@ // // no-check-code +#include "cdatapack/cdatapack.h" + // be64toh is only available if _DEFAULT_SOURCE is defined for glibc >= 2.19, // or _BSD_SOURCE is defined for glibc < 2.19. These have to be defined before // #include . Macros testing glibc version are defined by @@ -36,11 +38,10 @@ #endif /* #if defined(__APPLE__) */ #include -#include "portability/inet.h" -#include "portability/unistd.h" -#include "cdatapack.h" -#include "buffer.h" +#include "clib/buffer.h" +#include "clib/portability/inet.h" +#include "clib/portability/unistd.h" #define MAX_PAGED_IN_DATAPACK (1024 * 1024 * 1024) diff --git a/cdatapack/cdatapack_dump.c b/cdatapack/cdatapack_dump.c --- a/cdatapack/cdatapack_dump.c +++ b/cdatapack/cdatapack_dump.c @@ -5,12 +5,13 @@ // // no-check-code +#include #include #include #include -#include -#include "convert.h" -#include "cdatapack.h" + +#include "cdatapack/cdatapack.h" +#include "clib/convert.h" #define DATAIDX_EXT ".dataidx" #define DATAPACK_EXT ".datapack" diff --git a/cdatapack/cdatapack_get.c b/cdatapack/cdatapack_get.c --- a/cdatapack/cdatapack_get.c +++ b/cdatapack/cdatapack_get.c @@ -9,9 +9,9 @@ #include #include -#include "cdatapack.h" +#include "cdatapack/cdatapack.h" +#include "clib/convert.h" #include "clib/sha1.h" -#include "convert.h" #define DATAIDX_EXT ".dataidx" #define DATAPACK_EXT ".datapack" diff --git a/clib/buffer.c b/clib/buffer.c --- a/clib/buffer.c +++ b/clib/buffer.c @@ -8,7 +8,7 @@ #include #include -#include "buffer.h" +#include "clib/buffer.h" bool buffer_append( char **buffer, size_t *buffer_idx, size_t *buffer_sz, diff --git a/cstore/bitmanipulation.h b/cstore/bitmanipulation.h --- a/cstore/bitmanipulation.h +++ b/cstore/bitmanipulation.h @@ -1,7 +1,7 @@ #ifndef _HG_BITMANIPULATION_H_ #define _HG_BITMANIPULATION_H_ -#include "compat.h" +#include "cstore/compat.h" static inline uint32_t getbe32(const char *c) { diff --git a/cstore/datapackstore.h b/cstore/datapackstore.h --- a/cstore/datapackstore.h +++ b/cstore/datapackstore.h @@ -11,16 +11,16 @@ #define DATAPACKSTORE_H extern "C" { -#include "cdatapack.h" +#include "cdatapack/cdatapack.h" } +#include #include -#include #include #include -#include "key.h" -#include "portability/portability.h" +#include "clib/portability/portability.h" +#include "cstore/key.h" const clock_t PACK_REFRESH_RATE = 0.1 * CLOCKS_PER_SEC; diff --git a/cstore/datapackstore.cpp b/cstore/datapackstore.cpp --- a/cstore/datapackstore.cpp +++ b/cstore/datapackstore.cpp @@ -7,14 +7,15 @@ // // no-check-code -#include "datapackstore.h" -#include "key.h" +#include "cstore/datapackstore.h" #include #include #include #include +#include "cstore/key.h" + std::vector getAvailablePackFiles(const std::string &path) { std::vector results; diff --git a/cstore/key.h b/cstore/key.h --- a/cstore/key.h +++ b/cstore/key.h @@ -11,11 +11,10 @@ #define KEY_H #include +#include #include -#include -#include "convert.h" -#include "convert.h" +#include "clib/convert.h" /* Represents a key into the Mercurial store. Each key is a (name, node) pair, * though store implementations can choose to ignore the name in some cases. */ diff --git a/cstore/mpatch.h b/cstore/mpatch.h --- a/cstore/mpatch.h +++ b/cstore/mpatch.h @@ -5,6 +5,8 @@ #define MPATCH_ERR_CANNOT_BE_DECODED -2 #define MPATCH_ERR_INVALID_PATCH -1 +#include "clib/portability/unistd.h" + struct mpatch_frag { int start, end, len; const char *data; diff --git a/cstore/mpatch.c b/cstore/mpatch.c --- a/cstore/mpatch.c +++ b/cstore/mpatch.c @@ -19,13 +19,13 @@ This software may be used and distributed according to the terms of the GNU General Public License, incorporated herein by reference. */ +#include "cstore/mpatch.h" #include #include -#include "bitmanipulation.h" -#include "compat.h" -#include "mpatch.h" +#include "cstore/bitmanipulation.h" +#include "cstore/compat.h" static struct mpatch_flist *lalloc(ssize_t size) { diff --git a/cstore/py-cdatapack.h b/cstore/py-cdatapack.h --- a/cstore/py-cdatapack.h +++ b/cstore/py-cdatapack.h @@ -15,7 +15,7 @@ #include extern "C" { -#include "cdatapack.h" +#include "cdatapack/cdatapack.h" } // ==== py_cdatapack PyObject declaration ==== diff --git a/cstore/py-cstore.cpp b/cstore/py-cstore.cpp --- a/cstore/py-cstore.cpp +++ b/cstore/py-cstore.cpp @@ -13,9 +13,9 @@ #include -#include "py-cdatapack.h" -#include "py-datapackstore.h" -#include "py-treemanifest.h" +#include "cstore/py-cdatapack.h" +#include "cstore/py-datapackstore.h" +#include "cstore/py-treemanifest.h" static PyMethodDef mod_methods[] = { {NULL, NULL} diff --git a/cstore/py-datapackstore.h b/cstore/py-datapackstore.h --- a/cstore/py-datapackstore.h +++ b/cstore/py-datapackstore.h @@ -15,14 +15,14 @@ #include extern "C" { -#include "cdatapack.h" +#include "cdatapack/cdatapack.h" } -#include "pythonutil.h" -#include "datapackstore.h" -#include "key.h" -#include "py-structs.h" -#include "uniondatapackstore.h" +#include "cstore/datapackstore.h" +#include "cstore/key.h" +#include "cstore/py-structs.h" +#include "cstore/pythonutil.h" +#include "cstore/uniondatapackstore.h" // --------- DatapackStore Implementation --------- diff --git a/cstore/py-structs.h b/cstore/py-structs.h --- a/cstore/py-structs.h +++ b/cstore/py-structs.h @@ -12,8 +12,9 @@ #include -#include "datapackstore.h" -#include "uniondatapackstore.h" +#include "cstore/datapackstore.h" +#include "cstore/pythonutil.h" +#include "cstore/uniondatapackstore.h" struct py_datapackstore { PyObject_HEAD; diff --git a/cstore/py-treemanifest.h b/cstore/py-treemanifest.h --- a/cstore/py-treemanifest.h +++ b/cstore/py-treemanifest.h @@ -14,12 +14,12 @@ #include #include -#include "convert.h" -#include "manifest.h" -#include "pythonutil.h" -#include "treemanifest.h" -#include "uniondatapackstore.h" -#include "py-structs.h" +#include "clib/convert.h" +#include "cstore/py-structs.h" +#include "cstore/pythonutil.h" +#include "cstore/uniondatapackstore.h" +#include "ctreemanifest/manifest.h" +#include "ctreemanifest/treemanifest.h" #define FILENAME_BUFFER_SIZE 16348 #define FLAG_SIZE 1 diff --git a/cstore/pythonutil.h b/cstore/pythonutil.h --- a/cstore/pythonutil.h +++ b/cstore/pythonutil.h @@ -20,10 +20,10 @@ // Py_BuildValue treats NULL as NONE, so we have to have a non-null pointer. #define MAGIC_EMPTY_STRING "" -#include "store.h" -#include "key.h" -#include "match.h" -#include "treemanifest.h" +#include "cstore/key.h" +#include "cstore/match.h" +#include "cstore/store.h" +#include "ctreemanifest/treemanifest.h" /** * C++ exception that represents an issue at the python C api level. diff --git a/cstore/store.h b/cstore/store.h --- a/cstore/store.h +++ b/cstore/store.h @@ -10,9 +10,10 @@ #ifndef STORE_H #define STORE_H -#include "key.h" +#include #include -#include + +#include "cstore/key.h" class ConstantStringRef { private: diff --git a/cstore/uniondatapackstore.h b/cstore/uniondatapackstore.h --- a/cstore/uniondatapackstore.h +++ b/cstore/uniondatapackstore.h @@ -10,17 +10,17 @@ #ifndef UNIONDATAPACKSTORE_H #define UNIONDATAPACKSTORE_H +#include +#include +#include + extern "C" { -#include "cdatapack.h" +#include "cdatapack/cdatapack.h" } -#include "key.h" -#include "datapackstore.h" -#include "store.h" - -#include -#include -#include +#include "cstore/key.h" +#include "cstore/datapackstore.h" +#include "cstore/store.h" class UnionDatapackStore; class UnionDatapackStoreKeyIterator : public KeyIterator { diff --git a/cstore/uniondatapackstore.cpp b/cstore/uniondatapackstore.cpp --- a/cstore/uniondatapackstore.cpp +++ b/cstore/uniondatapackstore.cpp @@ -7,13 +7,13 @@ // // no-check-code +#include "cstore/uniondatapackstore.h" + #include #include -#include "uniondatapackstore.h" - extern "C" { -#include "mpatch.h" +#include "cstore/mpatch.h" } UnionDatapackStore::UnionDatapackStore(std::vector stores) : diff --git a/ctreemanifest/manifest.h b/ctreemanifest/manifest.h --- a/ctreemanifest/manifest.h +++ b/ctreemanifest/manifest.h @@ -14,7 +14,7 @@ #include #include -#include "convert.h" +#include "clib/convert.h" class Manifest; class ManifestIterator; @@ -41,15 +41,17 @@ bool isnull() const; }; -#include "manifest_entry.h" -#include "store.h" - enum FindResultType { RESULT_FILE, RESULT_DIRECTORY, RESULT_FILE_OR_DIRECTORY, }; +class ManifestEntry; + +#include "cstore/store.h" +#include "ctreemanifest/manifest_entry.h" + /** * This class represents a view on a particular Manifest instance. It provides * access to the list of files/directories at one level of the tree, not the diff --git a/ctreemanifest/manifest.cpp b/ctreemanifest/manifest.cpp --- a/ctreemanifest/manifest.cpp +++ b/ctreemanifest/manifest.cpp @@ -7,7 +7,8 @@ // // no-check-code -#include "manifest.h" +#include "ctreemanifest/manifest.h" + #include "clib/sha1.h" Manifest::Manifest(ConstantStringRef &rawobj, const char *node) : diff --git a/ctreemanifest/manifest_entry.h b/ctreemanifest/manifest_entry.h --- a/ctreemanifest/manifest_entry.h +++ b/ctreemanifest/manifest_entry.h @@ -14,11 +14,9 @@ #include #include -class ManifestEntry; - -#include "convert.h" -#include "manifest.h" -#include "manifest_fetcher.h" +#include "clib/convert.h" +#include "ctreemanifest/manifest.h" +#include "ctreemanifest/manifest_fetcher.h" #define MANIFEST_DIRECTORY_FLAG 't' #define MANIFEST_DIRECTORY_FLAGPTR (&"t"[0]) diff --git a/ctreemanifest/manifest_entry.cpp b/ctreemanifest/manifest_entry.cpp --- a/ctreemanifest/manifest_entry.cpp +++ b/ctreemanifest/manifest_entry.cpp @@ -7,7 +7,8 @@ // // no-check-code -#include "manifest_entry.h" +#include "ctreemanifest/manifest_entry.h" + #include ManifestEntry::ManifestEntry() diff --git a/ctreemanifest/manifest_fetcher.h b/ctreemanifest/manifest_fetcher.h --- a/ctreemanifest/manifest_fetcher.h +++ b/ctreemanifest/manifest_fetcher.h @@ -15,8 +15,8 @@ class ManifestFetcher; -#include "manifest.h" -#include "store.h" +#include "cstore/store.h" +#include "ctreemanifest/manifest.h" /** * Class used to obtain Manifests, given a path and node. diff --git a/ctreemanifest/manifest_fetcher.cpp b/ctreemanifest/manifest_fetcher.cpp --- a/ctreemanifest/manifest_fetcher.cpp +++ b/ctreemanifest/manifest_fetcher.cpp @@ -7,7 +7,7 @@ // // no-check-code -#include "manifest_fetcher.h" +#include "ctreemanifest/manifest_fetcher.h" ManifestFetcher::ManifestFetcher(std::shared_ptr store) : _store(store) { diff --git a/ctreemanifest/treemanifest.h b/ctreemanifest/treemanifest.h --- a/ctreemanifest/treemanifest.h +++ b/ctreemanifest/treemanifest.h @@ -14,9 +14,10 @@ #include #include -#include "manifest.h" -#include "manifest_fetcher.h" -#include "match.h" +#include "cstore/match.h" +#include "ctreemanifest/manifest.h" +#include "ctreemanifest/manifest_entry.h" +#include "ctreemanifest/manifest_fetcher.h" enum FindResult { FIND_PATH_OK, diff --git a/ctreemanifest/treemanifest.cpp b/ctreemanifest/treemanifest.cpp --- a/ctreemanifest/treemanifest.cpp +++ b/ctreemanifest/treemanifest.cpp @@ -7,7 +7,8 @@ // // no-check-code -#include "treemanifest.h" +#include "ctreemanifest/treemanifest.h" + #include /** diff --git a/setup.py b/setup.py --- a/setup.py +++ b/setup.py @@ -161,13 +161,14 @@ availablelibraries = { 'datapack': { "sources" : ["cdatapack/cdatapack.c"], - "include_dirs" : ["clib"] + include_dirs, + "include_dirs" : ["."] + include_dirs, "libraries" : ["lz4", SHA1_LIBRARY], "extra_args" : filter(None, [STDC99, WALL, WERROR, WSTRICTPROTOTYPES] + cflags), }, 'mpatch': { - 'sources': ['cstore/mpatch.c'] + "sources": ["cstore/mpatch.c"], + "include_dirs" : ["."] + include_dirs, }, "sha1detectcoll": { "sources" : [ @@ -248,10 +249,6 @@ ], include_dirs=[ '.', - 'ctreemanifest', - 'cdatapack', - 'clib', - 'cstore', 'third-party', ] + include_dirs, library_dirs=[ @@ -316,7 +313,7 @@ 'traceprof': [ Extension('hgext3rd.traceprof', sources=['hgext3rd/traceprof.pyx'], - include_dirs=['hgext3rd/'], + include_dirs=['hgext3rd'], extra_compile_args=filter(None, [ OPTIMIZATION, STDCPP0X, WALL, WEXTRA, WCONVERSION, PEDANTIC, PRODUCEDEBUGSYMBOLS