annotate mercurial/compat.h @ 35816:f6ca1e11d8b4 stable

revset: evaluate filesets against each revision for 'file()' (issue5778) After f2aeff8a87b6, the fileset was evaluated to a set of files against the working directory, and then those files were applied against each revision. The result was nonsense. For example, `hg log -r 'file("set:exec()")'` on the Mercurial repo listed revision 0 because it has the `hg` script, which is currently +x. But that bit wasn't applied until revision 280 (which 'contains()' properly indicates). This technique was borrowed from checkstatus(), which services adds(), modifies(), and removes(), so it seems safe enough. The 'r:' case is explicitly assigned to wdirrev, freeing up rev=None to mean "re-evaluate at each revision". The distinction is important to avoid behavior changes with `hg log set:...` (test-largefiles-misc.t and test-fileset-generated.t drop current log output without this). I'm not sure what the right behavior for that is (1fd352aa08fc explicitly enabled this behavior for graphlog), but the day before the release isn't the time to experiment.
author Matt Harbison <matt_harbison@yahoo.com>
date Sun, 28 Jan 2018 14:08:59 -0500
parents f4433f2713d0
children 11ed2eadf937
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
29444
284d742e5611 internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff changeset
1 #ifndef _HG_COMPAT_H_
284d742e5611 internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff changeset
2 #define _HG_COMPAT_H_
284d742e5611 internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff changeset
3
284d742e5611 internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff changeset
4 #ifdef _WIN32
284d742e5611 internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff changeset
5 #ifdef _MSC_VER
284d742e5611 internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff changeset
6 /* msvc 6.0 has problems */
284d742e5611 internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff changeset
7 #define inline __inline
29521
83147ff53112 compat: provide a declaration of ssize_t, for MS windows
Maciej Fijalkowski <fijall@gmail.com>
parents: 29444
diff changeset
8 #if defined(_WIN64)
83147ff53112 compat: provide a declaration of ssize_t, for MS windows
Maciej Fijalkowski <fijall@gmail.com>
parents: 29444
diff changeset
9 typedef __int64 ssize_t;
33926
f4433f2713d0 encoding: add function to test if a str consists of ASCII characters
Yuya Nishihara <yuya@tcha.org>
parents: 29549
diff changeset
10 typedef unsigned __int64 uintptr_t;
29521
83147ff53112 compat: provide a declaration of ssize_t, for MS windows
Maciej Fijalkowski <fijall@gmail.com>
parents: 29444
diff changeset
11 #else
29549
7b22599dcb85 compat: define ssize_t as int on 32bit Windows, silences C4142 warning
Yuya Nishihara <yuya@tcha.org>
parents: 29521
diff changeset
12 typedef int ssize_t;
33926
f4433f2713d0 encoding: add function to test if a str consists of ASCII characters
Yuya Nishihara <yuya@tcha.org>
parents: 29549
diff changeset
13 typedef unsigned int uintptr_t;
29521
83147ff53112 compat: provide a declaration of ssize_t, for MS windows
Maciej Fijalkowski <fijall@gmail.com>
parents: 29444
diff changeset
14 #endif
29444
284d742e5611 internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff changeset
15 typedef signed char int8_t;
284d742e5611 internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff changeset
16 typedef short int16_t;
284d742e5611 internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff changeset
17 typedef long int32_t;
284d742e5611 internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff changeset
18 typedef __int64 int64_t;
284d742e5611 internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff changeset
19 typedef unsigned char uint8_t;
284d742e5611 internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff changeset
20 typedef unsigned short uint16_t;
284d742e5611 internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff changeset
21 typedef unsigned long uint32_t;
284d742e5611 internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff changeset
22 typedef unsigned __int64 uint64_t;
284d742e5611 internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff changeset
23 #else
284d742e5611 internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff changeset
24 #include <stdint.h>
284d742e5611 internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff changeset
25 #endif
284d742e5611 internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff changeset
26 #else
284d742e5611 internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff changeset
27 /* not windows */
284d742e5611 internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff changeset
28 #include <sys/types.h>
284d742e5611 internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff changeset
29 #if defined __BEOS__ && !defined __HAIKU__
284d742e5611 internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff changeset
30 #include <ByteOrder.h>
284d742e5611 internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff changeset
31 #else
284d742e5611 internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff changeset
32 #include <arpa/inet.h>
284d742e5611 internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff changeset
33 #endif
284d742e5611 internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff changeset
34 #include <inttypes.h>
284d742e5611 internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff changeset
35 #endif
284d742e5611 internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff changeset
36
284d742e5611 internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff changeset
37 #if defined __hpux || defined __SUNPRO_C || defined _AIX
284d742e5611 internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff changeset
38 #define inline
284d742e5611 internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff changeset
39 #endif
284d742e5611 internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff changeset
40
284d742e5611 internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff changeset
41 #ifdef __linux
284d742e5611 internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff changeset
42 #define inline __inline
284d742e5611 internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff changeset
43 #endif
284d742e5611 internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff changeset
44
284d742e5611 internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff changeset
45 #endif