Mercurial > hg
annotate tests/test-encode.t @ 50303:0d3690f8ce2a stable
cext: fix for PyLong refactoring in CPython 3.12
Compiling Mercurial with Python 3.12 a5 would fail with:
mercurial/cext/dirs.c: In function '_addpath':
mercurial/cext/dirs.c:19:44: error: 'PyLongObject' {aka 'struct _longobject'} has no member named 'ob_digit'
19 | #define PYLONG_VALUE(o) ((PyLongObject *)o)->ob_digit[0]
| ^~
mercurial/cext/dirs.c:97:25: note: in expansion of macro 'PYLONG_VALUE'
97 | PYLONG_VALUE(val) += 1;
| ^~~~~~~~~~~~
mercurial/cext/dirs.c:19:44: error: 'PyLongObject' {aka 'struct _longobject'} has no member named 'ob_digit'
19 | #define PYLONG_VALUE(o) ((PyLongObject *)o)->ob_digit[0]
| ^~
mercurial/cext/dirs.c:108:17: note: in expansion of macro 'PYLONG_VALUE'
108 | PYLONG_VALUE(val) = 1;
| ^~~~~~~~~~~~
mercurial/cext/dirs.c: In function '_delpath':
mercurial/cext/dirs.c:19:44: error: 'PyLongObject' {aka 'struct _longobject'} has no member named 'ob_digit'
19 | #define PYLONG_VALUE(o) ((PyLongObject *)o)->ob_digit[0]
| ^~
mercurial/cext/dirs.c:145:23: note: in expansion of macro 'PYLONG_VALUE'
145 | if (--PYLONG_VALUE(val) <= 0) {
| ^~~~~~~~~~~~
This was caused by
https://github.com/python/cpython/commit/c1b1f51cd1632f0b77dacd43092fb44ed5e053a9 .
author | Mads Kiilerich <mads@kiilerich.com> |
---|---|
date | Tue, 07 Mar 2023 16:25:51 +0100 |
parents | 55c6ebd11cb9 |
children |
rev | line source |
---|---|
12416 | 1 Test encode/decode filters |
1258 | 2 |
49621
55c6ebd11cb9
tests: run many tests in $TESTTMP/repo instead of $TESTTMP
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
48339
diff
changeset
|
3 $ hg init repo |
55c6ebd11cb9
tests: run many tests in $TESTTMP/repo instead of $TESTTMP
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
48339
diff
changeset
|
4 $ cd repo |
12416 | 5 $ cat > .hg/hgrc <<EOF |
6 > [encode] | |
7 > not.gz = tr [:lower:] [:upper:] | |
8 > *.gz = gzip -d | |
9 > [decode] | |
10 > not.gz = tr [:upper:] [:lower:] | |
11 > *.gz = gzip | |
12 > EOF | |
13 $ echo "this is a test" | gzip > a.gz | |
14 $ echo "this is a test" > not.gz | |
15 $ hg add * | |
16 $ hg ci -m "test" | |
1258 | 17 |
12416 | 18 no changes |
19 | |
20 $ hg status | |
21 $ touch * | |
22 | |
23 no changes | |
24 | |
25 $ hg status | |
26 | |
27 check contents in repo are encoded | |
1258 | 28 |
14182
ec5886db9dc6
tests: fix deprecated use of hg debugdata/debugindex
Sune Foldager <cryo@cyanite.org>
parents:
12416
diff
changeset
|
29 $ hg debugdata a.gz 0 |
12416 | 30 this is a test |
14182
ec5886db9dc6
tests: fix deprecated use of hg debugdata/debugindex
Sune Foldager <cryo@cyanite.org>
parents:
12416
diff
changeset
|
31 $ hg debugdata not.gz 0 |
12416 | 32 THIS IS A TEST |
33 | |
34 check committed content was decoded | |
1258 | 35 |
12416 | 36 $ gunzip < a.gz |
37 this is a test | |
38 $ cat not.gz | |
39 this is a test | |
40 $ rm * | |
41 $ hg co -C | |
42 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1258 | 43 |
12416 | 44 check decoding of our new working dir copy |
1258 | 45 |
12416 | 46 $ gunzip < a.gz |
47 this is a test | |
48 $ cat not.gz | |
49 this is a test | |
1258 | 50 |
12416 | 51 check hg cat operation |
6093
f5b00b6e426a
Option --decode for hg cat to apply decode filters.
Jesse Glick <jesse.glick@sun.com>
parents:
3853
diff
changeset
|
52 |
12416 | 53 $ hg cat a.gz |
54 this is a test | |
55 $ hg cat --decode a.gz | gunzip | |
56 this is a test | |
57 $ mkdir subdir | |
58 $ cd subdir | |
59 $ hg -R .. cat ../a.gz | |
60 this is a test | |
61 $ hg -R .. cat --decode ../a.gz | gunzip | |
62 this is a test | |
37461
538353b80676
procutil: fix error message of tempfile filter
Yuya Nishihara <yuya@tcha.org>
parents:
16913
diff
changeset
|
63 $ cd .. |
538353b80676
procutil: fix error message of tempfile filter
Yuya Nishihara <yuya@tcha.org>
parents:
16913
diff
changeset
|
64 |
538353b80676
procutil: fix error message of tempfile filter
Yuya Nishihara <yuya@tcha.org>
parents:
16913
diff
changeset
|
65 check tempfile filter |
538353b80676
procutil: fix error message of tempfile filter
Yuya Nishihara <yuya@tcha.org>
parents:
16913
diff
changeset
|
66 |
538353b80676
procutil: fix error message of tempfile filter
Yuya Nishihara <yuya@tcha.org>
parents:
16913
diff
changeset
|
67 $ hg cat a.gz --decode --config 'decode.*.gz=tempfile:gzip -c INFILE > OUTFILE' | gunzip |
538353b80676
procutil: fix error message of tempfile filter
Yuya Nishihara <yuya@tcha.org>
parents:
16913
diff
changeset
|
68 this is a test |
538353b80676
procutil: fix error message of tempfile filter
Yuya Nishihara <yuya@tcha.org>
parents:
16913
diff
changeset
|
69 $ hg cat a.gz --decode --config 'decode.*.gz=tempfile:sh -c "exit 1"' |
538353b80676
procutil: fix error message of tempfile filter
Yuya Nishihara <yuya@tcha.org>
parents:
16913
diff
changeset
|
70 abort: command '*' failed: exited with status 1 (glob) |
538353b80676
procutil: fix error message of tempfile filter
Yuya Nishihara <yuya@tcha.org>
parents:
16913
diff
changeset
|
71 [255] |
16913
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
14182
diff
changeset
|
72 |
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
14182
diff
changeset
|
73 $ cd .. |