Mercurial > hg
annotate tests/test-revlog.t @ 33331:4bae3c117b57
scmutil: make cleanupnodes delete divergent bookmarks
cleanupnodes takes care of bookmark movement, and bookmark movement could
cause bookmark divergent resolution as a side effect. This patch adds such
bookmark divergent resolution logic so future rebase migration will be
easier.
The revset is carefully written to be equivalent to what rebase does today.
Although I think it might make sense to remove divergent bookmarks more
aggressively, for example:
F book@1
|
E book@2
|
| D book
| |
| C
|/
B book@3
|
A
When rebase -s C -d E, "book@1" will be removed, "book@3" will be kept,
and the end result is:
D book
|
C
|
F
|
E book@2 (?)
|
B book@3
|
A
The question is should we keep book@2? The current logic keeps it. If we
choose not to (makes some sense to me), the "deleterevs" revset could be
simplified to "newnode % oldnode".
For now, I just make it compatible with the existing behavior. If we want to
make the "deleterevs" revset simpler, we can always do it in the future.
author | Jun Wu <quark@fb.com> |
---|---|
date | Mon, 26 Jun 2017 13:13:51 -0700 |
parents | 36d3559c69a6 |
children | 71d1bbf1617e |
rev | line source |
---|---|
32391
3ea1f1e71a0a
tests: tests for revlog version and flags loading
Gregory Szorc <gregory.szorc@gmail.com>
parents:
32371
diff
changeset
|
1 $ hg init empty-repo |
3ea1f1e71a0a
tests: tests for revlog version and flags loading
Gregory Szorc <gregory.szorc@gmail.com>
parents:
32371
diff
changeset
|
2 $ cd empty-repo |
3ea1f1e71a0a
tests: tests for revlog version and flags loading
Gregory Szorc <gregory.szorc@gmail.com>
parents:
32371
diff
changeset
|
3 |
3ea1f1e71a0a
tests: tests for revlog version and flags loading
Gregory Szorc <gregory.szorc@gmail.com>
parents:
32371
diff
changeset
|
4 Flags on revlog version 0 are rejected |
3ea1f1e71a0a
tests: tests for revlog version and flags loading
Gregory Szorc <gregory.szorc@gmail.com>
parents:
32371
diff
changeset
|
5 |
3ea1f1e71a0a
tests: tests for revlog version and flags loading
Gregory Szorc <gregory.szorc@gmail.com>
parents:
32371
diff
changeset
|
6 >>> with open('.hg/store/00changelog.i', 'wb') as fh: |
3ea1f1e71a0a
tests: tests for revlog version and flags loading
Gregory Szorc <gregory.szorc@gmail.com>
parents:
32371
diff
changeset
|
7 ... fh.write('\x00\x01\x00\x00') |
3ea1f1e71a0a
tests: tests for revlog version and flags loading
Gregory Szorc <gregory.szorc@gmail.com>
parents:
32371
diff
changeset
|
8 |
3ea1f1e71a0a
tests: tests for revlog version and flags loading
Gregory Szorc <gregory.szorc@gmail.com>
parents:
32371
diff
changeset
|
9 $ hg log |
32392
36d3559c69a6
revlog: tweak wording and logic for flags validation
Gregory Szorc <gregory.szorc@gmail.com>
parents:
32391
diff
changeset
|
10 abort: unknown flags (0x01) in version 0 revlog 00changelog.i! |
32391
3ea1f1e71a0a
tests: tests for revlog version and flags loading
Gregory Szorc <gregory.szorc@gmail.com>
parents:
32371
diff
changeset
|
11 [255] |
3ea1f1e71a0a
tests: tests for revlog version and flags loading
Gregory Szorc <gregory.szorc@gmail.com>
parents:
32371
diff
changeset
|
12 |
3ea1f1e71a0a
tests: tests for revlog version and flags loading
Gregory Szorc <gregory.szorc@gmail.com>
parents:
32371
diff
changeset
|
13 Unknown flags on revlog version 1 are rejected |
3ea1f1e71a0a
tests: tests for revlog version and flags loading
Gregory Szorc <gregory.szorc@gmail.com>
parents:
32371
diff
changeset
|
14 |
3ea1f1e71a0a
tests: tests for revlog version and flags loading
Gregory Szorc <gregory.szorc@gmail.com>
parents:
32371
diff
changeset
|
15 >>> with open('.hg/store/00changelog.i', 'wb') as fh: |
3ea1f1e71a0a
tests: tests for revlog version and flags loading
Gregory Szorc <gregory.szorc@gmail.com>
parents:
32371
diff
changeset
|
16 ... fh.write('\x00\x04\x00\x01') |
3ea1f1e71a0a
tests: tests for revlog version and flags loading
Gregory Szorc <gregory.szorc@gmail.com>
parents:
32371
diff
changeset
|
17 |
3ea1f1e71a0a
tests: tests for revlog version and flags loading
Gregory Szorc <gregory.szorc@gmail.com>
parents:
32371
diff
changeset
|
18 $ hg log |
32392
36d3559c69a6
revlog: tweak wording and logic for flags validation
Gregory Szorc <gregory.szorc@gmail.com>
parents:
32391
diff
changeset
|
19 abort: unknown flags (0x04) in version 1 revlog 00changelog.i! |
32391
3ea1f1e71a0a
tests: tests for revlog version and flags loading
Gregory Szorc <gregory.szorc@gmail.com>
parents:
32371
diff
changeset
|
20 [255] |
3ea1f1e71a0a
tests: tests for revlog version and flags loading
Gregory Szorc <gregory.szorc@gmail.com>
parents:
32371
diff
changeset
|
21 |
3ea1f1e71a0a
tests: tests for revlog version and flags loading
Gregory Szorc <gregory.szorc@gmail.com>
parents:
32371
diff
changeset
|
22 Unknown version is rejected |
3ea1f1e71a0a
tests: tests for revlog version and flags loading
Gregory Szorc <gregory.szorc@gmail.com>
parents:
32371
diff
changeset
|
23 |
3ea1f1e71a0a
tests: tests for revlog version and flags loading
Gregory Szorc <gregory.szorc@gmail.com>
parents:
32371
diff
changeset
|
24 >>> with open('.hg/store/00changelog.i', 'wb') as fh: |
3ea1f1e71a0a
tests: tests for revlog version and flags loading
Gregory Szorc <gregory.szorc@gmail.com>
parents:
32371
diff
changeset
|
25 ... fh.write('\x00\x00\x00\x02') |
3ea1f1e71a0a
tests: tests for revlog version and flags loading
Gregory Szorc <gregory.szorc@gmail.com>
parents:
32371
diff
changeset
|
26 |
3ea1f1e71a0a
tests: tests for revlog version and flags loading
Gregory Szorc <gregory.szorc@gmail.com>
parents:
32371
diff
changeset
|
27 $ hg log |
32392
36d3559c69a6
revlog: tweak wording and logic for flags validation
Gregory Szorc <gregory.szorc@gmail.com>
parents:
32391
diff
changeset
|
28 abort: unknown version (2) in revlog 00changelog.i! |
32391
3ea1f1e71a0a
tests: tests for revlog version and flags loading
Gregory Szorc <gregory.szorc@gmail.com>
parents:
32371
diff
changeset
|
29 [255] |
3ea1f1e71a0a
tests: tests for revlog version and flags loading
Gregory Szorc <gregory.szorc@gmail.com>
parents:
32371
diff
changeset
|
30 |
3ea1f1e71a0a
tests: tests for revlog version and flags loading
Gregory Szorc <gregory.szorc@gmail.com>
parents:
32371
diff
changeset
|
31 $ cd .. |
3ea1f1e71a0a
tests: tests for revlog version and flags loading
Gregory Szorc <gregory.szorc@gmail.com>
parents:
32371
diff
changeset
|
32 |
28656
b6ed2505d6cf
parsers: fix list sizing rounding error (SEC)
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
33 Test for CVE-2016-3630 |
b6ed2505d6cf
parsers: fix list sizing rounding error (SEC)
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
34 |
b6ed2505d6cf
parsers: fix list sizing rounding error (SEC)
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
35 $ hg init |
b6ed2505d6cf
parsers: fix list sizing rounding error (SEC)
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
36 |
b6ed2505d6cf
parsers: fix list sizing rounding error (SEC)
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
37 >>> open("a.i", "w").write( |
b6ed2505d6cf
parsers: fix list sizing rounding error (SEC)
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
38 ... """eJxjYGZgZIAAYQYGxhgom+k/FMx8YKx9ZUaKSOyqo4cnuKb8mbqHV5cBCVTMWb1Cwqkhe4Gsg9AD |
b6ed2505d6cf
parsers: fix list sizing rounding error (SEC)
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
39 ... Joa3dYtcYYYBAQ8Qr4OqZAYRICPTSr5WKd/42rV36d+8/VmrNpv7NP1jQAXrQE4BqQUARngwVA==""" |
b6ed2505d6cf
parsers: fix list sizing rounding error (SEC)
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
40 ... .decode("base64").decode("zlib")) |
b6ed2505d6cf
parsers: fix list sizing rounding error (SEC)
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
41 |
b6ed2505d6cf
parsers: fix list sizing rounding error (SEC)
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
42 $ hg debugindex a.i |
b6ed2505d6cf
parsers: fix list sizing rounding error (SEC)
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
43 rev offset length delta linkrev nodeid p1 p2 |
b6ed2505d6cf
parsers: fix list sizing rounding error (SEC)
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
44 0 0 19 -1 2 99e0332bd498 000000000000 000000000000 |
b6ed2505d6cf
parsers: fix list sizing rounding error (SEC)
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
45 1 19 12 0 3 6674f57a23d8 99e0332bd498 000000000000 |
28782
f736f98e16ca
mpatch: unify mpatchError (issue5182)
timeless <timeless@mozdev.org>
parents:
28656
diff
changeset
|
46 $ hg debugdata a.i 1 2>&1 | egrep 'Error:.*decoded' |
32371
151cc3b3d799
mpatch: switch to policy importer
Yuya Nishihara <yuya@tcha.org>
parents:
28783
diff
changeset
|
47 (mercurial\.\w+\.mpatch\.)?mpatchError: patch cannot be decoded (re) |