tests/test-audit-path.t
author Patrick Mezard <patrick@mezard.eu>
Fri, 04 May 2012 14:19:55 +0200
branchstable
changeset 16596 95ca6c8b38da
parent 16350 4f795f5fbb0b
child 16908 6a997aacba5d
permissions -rw-r--r--
subrepo: do not traceback on .hgsubstate parsing errors Note that aborting in subrepo.state() prevents "repairing" commands like revert to be issued. The user will have to edit the .hgsubstate manually (but he probably had already otherwise this would not be failing). The same behaviour already happens with invalid .hgsub entries.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
15441
e0348815e806 tests: use 'hghave symlink' for tests using symlinks
Mads Kiilerich <mads@kiilerich.com>
parents: 14116
diff changeset
     1
  $ "$TESTDIR/hghave" symlink || exit 80
e0348815e806 tests: use 'hghave symlink' for tests using symlinks
Mads Kiilerich <mads@kiilerich.com>
parents: 14116
diff changeset
     2
11855
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
     3
  $ hg init
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
should fail
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
     6
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
     7
  $ hg add .hg/00changelog.i
15447
9910f60a37ee tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents: 15441
diff changeset
     8
  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
     9
  [255]
5158
d316124ebbea Make audit_path more stringent.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    10
11855
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    11
  $ mkdir a
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    12
  $ echo a > a/a
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    13
  $ hg ci -Ama
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    14
  adding a/a
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    15
  $ ln -s a b
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    16
  $ echo b > a/b
5158
d316124ebbea Make audit_path more stringent.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    17
11855
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    18
should fail
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    19
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    20
  $ hg add b/b
15447
9910f60a37ee tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents: 15441
diff changeset
    21
  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
    22
  [255]
11855
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 succeed
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
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    27
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    28
should still fail - maybe
5158
d316124ebbea Make audit_path more stringent.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    29
11855
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    30
  $ hg add b/b
15447
9910f60a37ee tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents: 15441
diff changeset
    31
  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
    32
  [255]
5158
d316124ebbea Make audit_path more stringent.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    33
11855
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    34
unbundle tampered bundle
5158
d316124ebbea Make audit_path more stringent.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    35
11855
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    36
  $ hg init target
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    37
  $ cd target
16350
4f795f5fbb0b tests: make tests work if directory contains special characters
Thomas Arendsen Hein <thomas@intevation.de>
parents: 15521
diff changeset
    38
  $ hg unbundle "$TESTDIR/bundles/tampered.hg"
11855
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    39
  adding changesets
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    40
  adding manifests
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    41
  adding file changes
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    42
  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
    43
  (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
    44
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    45
attack .hg/test
7554
11a4eb81fb4f test-audit-path: add more tests (issue 1450)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5158
diff changeset
    46
11855
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    47
  $ hg manifest -r0
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    48
  .hg/test
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    49
  $ hg update -Cr0
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    50
  abort: path contains illegal component: .hg/test
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 11855
diff changeset
    51
  [255]
7554
11a4eb81fb4f test-audit-path: add more tests (issue 1450)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5158
diff changeset
    52
11855
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    53
attack foo/.hg/test
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    54
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    55
  $ hg manifest -r1
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    56
  foo/.hg/test
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    57
  $ hg update -Cr1
13910
93452579df9e audit: improve nested repo message
Matt Mackall <mpm@selenic.com>
parents: 12640
diff changeset
    58
  abort: path 'foo/.hg/test' is inside nested repo 'foo'
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 11855
diff changeset
    59
  [255]
7554
11a4eb81fb4f test-audit-path: add more tests (issue 1450)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5158
diff changeset
    60
11855
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    61
attack back/test where back symlinks to ..
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    62
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    63
  $ hg manifest -r2
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    64
  back
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    65
  back/test
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]
11855
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    69
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    70
attack ../test
7554
11a4eb81fb4f test-audit-path: add more tests (issue 1450)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5158
diff changeset
    71
11855
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    72
  $ hg manifest -r3
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    73
  ../test
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    74
  $ hg update -Cr3
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    75
  abort: path contains illegal component: ../test
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 11855
diff changeset
    76
  [255]
11855
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    77
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    78
attack /tmp/test
7554
11a4eb81fb4f test-audit-path: add more tests (issue 1450)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5158
diff changeset
    79
11855
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    80
  $ hg manifest -r4
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    81
  /tmp/test
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    82
  $ hg update -Cr4
15521
117f9190c1ba tests: hide 'No such file or directory' messages
Mads Kiilerich <mads@kiilerich.com>
parents: 15447
diff changeset
    83
  abort: *: $TESTTMP/target//tmp/test (glob)
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 11855
diff changeset
    84
  [255]