Mercurial > hg
annotate tests/test-audit-path.t @ 17758:5863f0e4cd3a
histedit: replace various nodes lists with replacement graph (and issue3582)
This changeset rewrites the change tracking logic of histedit to record every
operation it does. Tracked operations record the full list of "old" node that
will eventually be removed to the list of new nodes that replace it. Operations
on temporary nodes are tracked too. Dropped changesets are also recorded as an
"old" node replacement by nothing. This logic is similar to the obsolescence
marker one and will be used for this purpose in later commit.
This new logic implies a big amount of change in the histedit code base.
histedit action functions now always return a tuple of
(new-ctx, [list of rewriting operations])
The old `created`, `replaced` and `tmpnodes` are no longer returned and stored
during histedit operation. When such information is necessary it is computed
from the replacement graph. This computation is done in the `processreplacement`
function.
The `replacemap` is also dropped. It is computed at the end of the command from the
graph. The `bootstrapcontinue` methods are altered to compute this different kind of
information.
This new mechanism requires much less information to be written on disk.
Note:
This changes allows a more accurate bookmark movement. bookmark on dropped
changeset are now move of their parent (or replacement of their parent)
instead of their children.
This fix issue3582
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Thu, 11 Oct 2012 08:36:50 +0200 |
parents | f2719b387380 |
children | 720308f741cb |
rev | line source |
---|---|
11855
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
1 $ hg init |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
2 |
16908
6a997aacba5d
tests: convert some 'hghave symlink' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
16350
diff
changeset
|
3 audit of .hg |
11855
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
4 |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
5 $ hg add .hg/00changelog.i |
15447
9910f60a37ee
tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents:
15441
diff
changeset
|
6 abort: path contains illegal component: .hg/00changelog.i (glob) |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
11855
diff
changeset
|
7 [255] |
5158
d316124ebbea
Make audit_path more stringent.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
8 |
16908
6a997aacba5d
tests: convert some 'hghave symlink' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
16350
diff
changeset
|
9 #if symlink |
6a997aacba5d
tests: convert some 'hghave symlink' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
16350
diff
changeset
|
10 |
6a997aacba5d
tests: convert some 'hghave symlink' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
16350
diff
changeset
|
11 Symlinks |
6a997aacba5d
tests: convert some 'hghave symlink' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
16350
diff
changeset
|
12 |
11855
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
13 $ mkdir a |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
14 $ echo a > a/a |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
15 $ hg ci -Ama |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
16 adding a/a |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
17 $ ln -s a b |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
18 $ echo b > a/b |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
19 $ hg add b/b |
15447
9910f60a37ee
tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents:
15441
diff
changeset
|
20 abort: path 'b/b' traverses symbolic link 'b' (glob) |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
11855
diff
changeset
|
21 [255] |
11855
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
22 $ hg add b |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
23 |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
24 should still fail - maybe |
5158
d316124ebbea
Make audit_path more stringent.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
25 |
11855
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
26 $ hg add b/b |
15447
9910f60a37ee
tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents:
15441
diff
changeset
|
27 abort: path 'b/b' traverses symbolic link 'b' (glob) |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
11855
diff
changeset
|
28 [255] |
5158
d316124ebbea
Make audit_path more stringent.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
29 |
16908
6a997aacba5d
tests: convert some 'hghave symlink' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
16350
diff
changeset
|
30 #endif |
6a997aacba5d
tests: convert some 'hghave symlink' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
16350
diff
changeset
|
31 |
6a997aacba5d
tests: convert some 'hghave symlink' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
16350
diff
changeset
|
32 |
11855
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
33 unbundle tampered bundle |
5158
d316124ebbea
Make audit_path more stringent.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
34 |
11855
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
35 $ hg init target |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
36 $ cd target |
16350
4f795f5fbb0b
tests: make tests work if directory contains special characters
Thomas Arendsen Hein <thomas@intevation.de>
parents:
15521
diff
changeset
|
37 $ hg unbundle "$TESTDIR/bundles/tampered.hg" |
11855
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
38 adding changesets |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
39 adding manifests |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
40 adding file changes |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
41 added 5 changesets with 6 changes to 6 files (+4 heads) |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
42 (run 'hg heads' to see heads, 'hg merge' to merge) |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
43 |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
44 attack .hg/test |
7554
11a4eb81fb4f
test-audit-path: add more tests (issue 1450)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
5158
diff
changeset
|
45 |
11855
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
46 $ hg manifest -r0 |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
47 .hg/test |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
48 $ hg update -Cr0 |
16908
6a997aacba5d
tests: convert some 'hghave symlink' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
16350
diff
changeset
|
49 abort: path contains illegal component: .hg/test (glob) |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
11855
diff
changeset
|
50 [255] |
7554
11a4eb81fb4f
test-audit-path: add more tests (issue 1450)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
5158
diff
changeset
|
51 |
11855
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
52 attack foo/.hg/test |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
53 |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
54 $ hg manifest -r1 |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
55 foo/.hg/test |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
56 $ hg update -Cr1 |
16908
6a997aacba5d
tests: convert some 'hghave symlink' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
16350
diff
changeset
|
57 abort: path 'foo/.hg/test' is inside nested repo 'foo' (glob) |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
11855
diff
changeset
|
58 [255] |
7554
11a4eb81fb4f
test-audit-path: add more tests (issue 1450)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
5158
diff
changeset
|
59 |
11855
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
60 attack back/test where back symlinks to .. |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
61 |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
62 $ hg manifest -r2 |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
63 back |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
64 back/test |
16908
6a997aacba5d
tests: convert some 'hghave symlink' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
16350
diff
changeset
|
65 #if symlink |
11855
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
66 $ hg update -Cr2 |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
67 abort: path 'back/test' traverses symbolic link 'back' |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
11855
diff
changeset
|
68 [255] |
16908
6a997aacba5d
tests: convert some 'hghave symlink' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
16350
diff
changeset
|
69 #else |
6a997aacba5d
tests: convert some 'hghave symlink' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
16350
diff
changeset
|
70 ('back' will be a file and cause some other system specific error) |
6a997aacba5d
tests: convert some 'hghave symlink' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
16350
diff
changeset
|
71 $ hg update -Cr2 |
6a997aacba5d
tests: convert some 'hghave symlink' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
16350
diff
changeset
|
72 abort: * (glob) |
6a997aacba5d
tests: convert some 'hghave symlink' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
16350
diff
changeset
|
73 [255] |
6a997aacba5d
tests: convert some 'hghave symlink' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
16350
diff
changeset
|
74 #endif |
11855
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
75 |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
76 attack ../test |
7554
11a4eb81fb4f
test-audit-path: add more tests (issue 1450)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
5158
diff
changeset
|
77 |
11855
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
78 $ hg manifest -r3 |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
79 ../test |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
80 $ hg update -Cr3 |
16908
6a997aacba5d
tests: convert some 'hghave symlink' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
16350
diff
changeset
|
81 abort: path contains illegal component: ../test (glob) |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
11855
diff
changeset
|
82 [255] |
11855
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
83 |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
84 attack /tmp/test |
7554
11a4eb81fb4f
test-audit-path: add more tests (issue 1450)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
5158
diff
changeset
|
85 |
11855
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
86 $ hg manifest -r4 |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
87 /tmp/test |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
88 $ hg update -Cr4 |
15521
117f9190c1ba
tests: hide 'No such file or directory' messages
Mads Kiilerich <mads@kiilerich.com>
parents:
15447
diff
changeset
|
89 abort: *: $TESTTMP/target//tmp/test (glob) |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
11855
diff
changeset
|
90 [255] |
16913
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
16908
diff
changeset
|
91 |
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
16908
diff
changeset
|
92 $ cd .. |