Mercurial > hg
annotate tests/test-audit-path.t @ 23976:344939126579 stable
largefiles: don't interfere with logging normal files
The previous code was adding standin files to the matcher's file list when
neither the standin file nor the original existed in the context. Somehow, this
was confusing the logging code into behaving differently from when the extension
wasn't loaded.
It seems that this was an attempt to support naming a directory that only
contains largefiles, as a test fails if the else clause is dropped entirely.
Therefore, only append the "standin" if it is a directory. This was found by
running the test suite with --config extensions.largefiles=.
The first added test used to log an additional cset that wasn't logged normally.
The only relation it had to file 'a' is that 'a' was the source of a move, but
it isn't clear why having '.hglf/a' in the list causes this change:
@@ -47,6 +47,11 @@
Make sure largefiles doesn't interfere with logging a regular file
$ hg log a --config extensions.largefiles=
+ changeset: 3:2ca5ba701980
+ user: test
+ date: Thu Jan 01 00:00:04 1970 +0000
+ summary: d
+
changeset: 0:9161b9aeaf16
user: test
date: Thu Jan 01 00:00:01 1970 +0000
The second added test used to complain about a file not being in the parent
revision:
@@ -1638,10 +1643,8 @@
Ensure that largefiles doesn't intefere with following a normal file
$ hg --config extensions.largefiles= log -f d -T '{desc}' -G
- @ c
- |
- o a
-
+ abort: cannot follow file not in parent revision: ".hglf/d"
+ [255]
$ hg log -f d/a -T '{desc}' -G
@ c
|
Note that there is still something fishy with the largefiles code, because when
using a glob pattern like this:
$ hg log 'glob:sub/*'
the pattern list would contain '.hglf/glob:sub/*'. None of the tests show this
(this test lives in test-largefiles.t at 1349), it was just something that I
noticed when the code was loaded up with print statements.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Fri, 30 Jan 2015 20:44:11 -0500 |
parents | ef60083b5536 |
children | 15c6eb0a51bd |
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 |
18506
ef60083b5536
tests: fix for windows - slashes and no serve
Mads Kiilerich <madski@unity3d.com>
parents:
18336
diff
changeset
|
89 abort: path contains illegal component: /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 .. |