Mercurial > hg
annotate tests/test-glog-topological.t @ 30435:b86a448a2965
zstd: vendor python-zstandard 0.5.0
As the commit message for the previous changeset says, we wish
for zstd to be a 1st class citizen in Mercurial. To make that
happen, we need to enable Python to talk to the zstd C API. And
that requires bindings.
This commit vendors a copy of existing Python bindings. Why do we
need to vendor? As the commit message of the previous commit says,
relying on systems in the wild to have the bindings or zstd present
is a losing proposition. By distributing the zstd and bindings with
Mercurial, we significantly increase our chances that zstd will
work. Since zstd will deliver a better end-user experience by
achieving better performance, this benefits our users. Another
reason is that the Python bindings still aren't stable and the
API is somewhat fluid. While Mercurial could be coded to target
multiple versions of the Python bindings, it is safer to bundle
an explicit, known working version.
The added Python bindings are mostly a fully-featured interface
to the zstd C API. They allow one-shot operations, streaming,
reading and writing from objects implements the file object
protocol, dictionary compression, control over low-level compression
parameters, and more. The Python bindings work on Python 2.6,
2.7, and 3.3+ and have been tested on Linux and Windows. There are
CFFI bindings, but they are lacking compared to the C extension.
Upstream work will be needed before we can support zstd with PyPy.
But it will be possible.
The files added in this commit come from Git commit
e637c1b214d5f869cf8116c550dcae23ec13b677 from
https://github.com/indygreg/python-zstandard and are added without
modifications. Some files from the upstream repository have been
omitted, namely files related to continuous integration.
In the spirit of full disclosure, I'm the maintainer of the
"python-zstandard" project and have authored 100% of the code
added in this commit. Unfortunately, the Python bindings have
not been formally code reviewed by anyone. While I've tested
much of the code thoroughly (I even have tests that fuzz APIs),
there's a good chance there are bugs, memory leaks, not well
thought out APIs, etc. If someone wants to review the code and
send feedback to the GitHub project, it would be greatly
appreciated.
Despite my involvement with both projects, my opinions of code
style differ from Mercurial's. The code in this commit introduces
numerous code style violations in Mercurial's linters. So, the code
is excluded from most lints. However, some violations I agree with.
These have been added to the known violations ignore list for now.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Thu, 10 Nov 2016 22:15:58 -0800 |
parents | 46825334f270 |
children | eb586ed5d8ce |
rev | line source |
---|---|
23565
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
1 This test file aims at test topological iteration and the various configuration it can has. |
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
2 |
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
3 $ cat >> $HGRCPATH << EOF |
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
4 > [ui] |
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
5 > logtemplate={rev}\n |
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
6 > EOF |
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
7 |
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
8 On this simple example, all topological branch are displayed in turn until we |
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
9 can finally display 0. this implies skipping from 8 to 3 and coming back to 7 |
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
10 later. |
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
11 |
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
12 $ hg init test01 |
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
13 $ cd test01 |
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
14 $ hg unbundle $TESTDIR/bundles/remote.hg |
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
15 adding changesets |
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
16 adding manifests |
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
17 adding file changes |
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
18 added 9 changesets with 7 changes to 4 files (+1 heads) |
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
19 (run 'hg heads' to see heads, 'hg merge' to merge) |
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
20 |
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
21 $ hg log -G |
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
22 o 8 |
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
23 | |
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
24 | o 7 |
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
25 | | |
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
26 | o 6 |
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
27 | | |
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
28 | o 5 |
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
29 | | |
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
30 | o 4 |
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
31 | | |
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
32 o | 3 |
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
33 | | |
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
34 o | 2 |
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
35 | | |
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
36 o | 1 |
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
37 |/ |
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
38 o 0 |
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
39 |
23567
1f080c9c6a35
groupbranchiter: support for non-contiguous revsets
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
23565
diff
changeset
|
40 |
1f080c9c6a35
groupbranchiter: support for non-contiguous revsets
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
23565
diff
changeset
|
41 (display all nodes) |
1f080c9c6a35
groupbranchiter: support for non-contiguous revsets
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
23565
diff
changeset
|
42 |
29348
2188f170f5b6
revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents:
28627
diff
changeset
|
43 $ hg log -G -r 'sort(all(), topo)' |
23565
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
44 o 8 |
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
45 | |
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
46 o 3 |
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
47 | |
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
48 o 2 |
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
49 | |
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
50 o 1 |
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
51 | |
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
52 | o 7 |
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
53 | | |
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
54 | o 6 |
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
55 | | |
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
56 | o 5 |
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
57 | | |
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
58 | o 4 |
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
59 |/ |
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
60 o 0 |
996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff
changeset
|
61 |
23567
1f080c9c6a35
groupbranchiter: support for non-contiguous revsets
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
23565
diff
changeset
|
62 |
30003
46825334f270
graphlog: preserve topo sort even if additional filter options specified
Yuya Nishihara <yuya@tcha.org>
parents:
29348
diff
changeset
|
63 (display nodes filtered by log options) |
46825334f270
graphlog: preserve topo sort even if additional filter options specified
Yuya Nishihara <yuya@tcha.org>
parents:
29348
diff
changeset
|
64 |
46825334f270
graphlog: preserve topo sort even if additional filter options specified
Yuya Nishihara <yuya@tcha.org>
parents:
29348
diff
changeset
|
65 $ hg log -G -r 'sort(all(), topo)' -k '.3' |
46825334f270
graphlog: preserve topo sort even if additional filter options specified
Yuya Nishihara <yuya@tcha.org>
parents:
29348
diff
changeset
|
66 o 8 |
46825334f270
graphlog: preserve topo sort even if additional filter options specified
Yuya Nishihara <yuya@tcha.org>
parents:
29348
diff
changeset
|
67 | |
46825334f270
graphlog: preserve topo sort even if additional filter options specified
Yuya Nishihara <yuya@tcha.org>
parents:
29348
diff
changeset
|
68 o 3 |
46825334f270
graphlog: preserve topo sort even if additional filter options specified
Yuya Nishihara <yuya@tcha.org>
parents:
29348
diff
changeset
|
69 | |
46825334f270
graphlog: preserve topo sort even if additional filter options specified
Yuya Nishihara <yuya@tcha.org>
parents:
29348
diff
changeset
|
70 ~ |
46825334f270
graphlog: preserve topo sort even if additional filter options specified
Yuya Nishihara <yuya@tcha.org>
parents:
29348
diff
changeset
|
71 o 7 |
46825334f270
graphlog: preserve topo sort even if additional filter options specified
Yuya Nishihara <yuya@tcha.org>
parents:
29348
diff
changeset
|
72 | |
46825334f270
graphlog: preserve topo sort even if additional filter options specified
Yuya Nishihara <yuya@tcha.org>
parents:
29348
diff
changeset
|
73 o 6 |
46825334f270
graphlog: preserve topo sort even if additional filter options specified
Yuya Nishihara <yuya@tcha.org>
parents:
29348
diff
changeset
|
74 | |
46825334f270
graphlog: preserve topo sort even if additional filter options specified
Yuya Nishihara <yuya@tcha.org>
parents:
29348
diff
changeset
|
75 ~ |
46825334f270
graphlog: preserve topo sort even if additional filter options specified
Yuya Nishihara <yuya@tcha.org>
parents:
29348
diff
changeset
|
76 |
23567
1f080c9c6a35
groupbranchiter: support for non-contiguous revsets
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
23565
diff
changeset
|
77 (revset skipping nodes) |
1f080c9c6a35
groupbranchiter: support for non-contiguous revsets
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
23565
diff
changeset
|
78 |
29348
2188f170f5b6
revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents:
28627
diff
changeset
|
79 $ hg log -G --rev 'sort(not (2+6), topo)' |
23567
1f080c9c6a35
groupbranchiter: support for non-contiguous revsets
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
23565
diff
changeset
|
80 o 8 |
1f080c9c6a35
groupbranchiter: support for non-contiguous revsets
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
23565
diff
changeset
|
81 | |
1f080c9c6a35
groupbranchiter: support for non-contiguous revsets
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
23565
diff
changeset
|
82 o 3 |
28627
d7af9b4ae7dd
graphmod: set default edge styles for ascii graphs (BC)
Martijn Pieters <mjpieters@fb.com>
parents:
23569
diff
changeset
|
83 : |
23567
1f080c9c6a35
groupbranchiter: support for non-contiguous revsets
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
23565
diff
changeset
|
84 o 1 |
1f080c9c6a35
groupbranchiter: support for non-contiguous revsets
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
23565
diff
changeset
|
85 | |
1f080c9c6a35
groupbranchiter: support for non-contiguous revsets
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
23565
diff
changeset
|
86 | o 7 |
28627
d7af9b4ae7dd
graphmod: set default edge styles for ascii graphs (BC)
Martijn Pieters <mjpieters@fb.com>
parents:
23569
diff
changeset
|
87 | : |
23567
1f080c9c6a35
groupbranchiter: support for non-contiguous revsets
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
23565
diff
changeset
|
88 | o 5 |
1f080c9c6a35
groupbranchiter: support for non-contiguous revsets
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
23565
diff
changeset
|
89 | | |
1f080c9c6a35
groupbranchiter: support for non-contiguous revsets
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
23565
diff
changeset
|
90 | o 4 |
1f080c9c6a35
groupbranchiter: support for non-contiguous revsets
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
23565
diff
changeset
|
91 |/ |
1f080c9c6a35
groupbranchiter: support for non-contiguous revsets
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
23565
diff
changeset
|
92 o 0 |
1f080c9c6a35
groupbranchiter: support for non-contiguous revsets
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
23565
diff
changeset
|
93 |
1f080c9c6a35
groupbranchiter: support for non-contiguous revsets
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
23565
diff
changeset
|
94 |
23568
740ae54573a3
groupbranchiter: allow callers to select the first branch
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
23567
diff
changeset
|
95 (begin) from the other branch |
740ae54573a3
groupbranchiter: allow callers to select the first branch
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
23567
diff
changeset
|
96 |
29348
2188f170f5b6
revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents:
28627
diff
changeset
|
97 $ hg log -G -r 'sort(all(), topo, topo.firstbranch=5)' |
23568
740ae54573a3
groupbranchiter: allow callers to select the first branch
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
23567
diff
changeset
|
98 o 7 |
740ae54573a3
groupbranchiter: allow callers to select the first branch
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
23567
diff
changeset
|
99 | |
740ae54573a3
groupbranchiter: allow callers to select the first branch
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
23567
diff
changeset
|
100 o 6 |
740ae54573a3
groupbranchiter: allow callers to select the first branch
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
23567
diff
changeset
|
101 | |
740ae54573a3
groupbranchiter: allow callers to select the first branch
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
23567
diff
changeset
|
102 o 5 |
740ae54573a3
groupbranchiter: allow callers to select the first branch
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
23567
diff
changeset
|
103 | |
740ae54573a3
groupbranchiter: allow callers to select the first branch
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
23567
diff
changeset
|
104 o 4 |
740ae54573a3
groupbranchiter: allow callers to select the first branch
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
23567
diff
changeset
|
105 | |
740ae54573a3
groupbranchiter: allow callers to select the first branch
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
23567
diff
changeset
|
106 | o 8 |
740ae54573a3
groupbranchiter: allow callers to select the first branch
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
23567
diff
changeset
|
107 | | |
740ae54573a3
groupbranchiter: allow callers to select the first branch
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
23567
diff
changeset
|
108 | o 3 |
740ae54573a3
groupbranchiter: allow callers to select the first branch
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
23567
diff
changeset
|
109 | | |
740ae54573a3
groupbranchiter: allow callers to select the first branch
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
23567
diff
changeset
|
110 | o 2 |
740ae54573a3
groupbranchiter: allow callers to select the first branch
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
23567
diff
changeset
|
111 | | |
740ae54573a3
groupbranchiter: allow callers to select the first branch
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
23567
diff
changeset
|
112 | o 1 |
740ae54573a3
groupbranchiter: allow callers to select the first branch
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
23567
diff
changeset
|
113 |/ |
740ae54573a3
groupbranchiter: allow callers to select the first branch
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
23567
diff
changeset
|
114 o 0 |
740ae54573a3
groupbranchiter: allow callers to select the first branch
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
23567
diff
changeset
|
115 |