tests/test-audit-path.t
author Denis Laxalde <denis.laxalde@logilab.fr>
Thu, 12 Oct 2017 09:39:50 +0200
changeset 34661 eb586ed5d8ce
parent 34555 989e884d1be9
child 34689 f07cf12e740f
permissions -rw-r--r--
transaction-summary: show the range of new revisions upon pull/unbundle (BC) Upon pull or unbundle, we display a message with the range of new revisions fetched. This revision range could readily be used after a pull to look out what's new with 'hg log'. The algorithm takes care of filtering "obsolete" revisions that might be present in transaction's "changes" but should not be displayed to the end user.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
27234
15c6eb0a51bd context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 18506
diff changeset
    30
  $ hg commit -m 'add symlink b'
15c6eb0a51bd context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 18506
diff changeset
    31
15c6eb0a51bd context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 18506
diff changeset
    32
15c6eb0a51bd context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 18506
diff changeset
    33
Test symlink traversing when accessing history:
15c6eb0a51bd context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 18506
diff changeset
    34
-----------------------------------------------
15c6eb0a51bd context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 18506
diff changeset
    35
15c6eb0a51bd context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 18506
diff changeset
    36
(build a changeset where the path exists as a directory)
15c6eb0a51bd context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 18506
diff changeset
    37
15c6eb0a51bd context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 18506
diff changeset
    38
  $ hg up 0
15c6eb0a51bd context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 18506
diff changeset
    39
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
15c6eb0a51bd context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 18506
diff changeset
    40
  $ mkdir b
15c6eb0a51bd context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 18506
diff changeset
    41
  $ echo c > b/a
15c6eb0a51bd context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 18506
diff changeset
    42
  $ hg add b/a
15c6eb0a51bd context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 18506
diff changeset
    43
  $ hg ci -m 'add directory b'
15c6eb0a51bd context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 18506
diff changeset
    44
  created new head
15c6eb0a51bd context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 18506
diff changeset
    45
15c6eb0a51bd context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 18506
diff changeset
    46
Test that hg cat does not do anything wrong the working copy has 'b' as directory
15c6eb0a51bd context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 18506
diff changeset
    47
15c6eb0a51bd context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 18506
diff changeset
    48
  $ hg cat b/a
15c6eb0a51bd context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 18506
diff changeset
    49
  c
15c6eb0a51bd context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 18506
diff changeset
    50
  $ hg cat -r "desc(directory)" b/a
15c6eb0a51bd context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 18506
diff changeset
    51
  c
15c6eb0a51bd context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 18506
diff changeset
    52
  $ hg cat -r "desc(symlink)" b/a
15c6eb0a51bd context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 18506
diff changeset
    53
  b/a: no such file in rev bc151a1f53bd
15c6eb0a51bd context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 18506
diff changeset
    54
  [1]
15c6eb0a51bd context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 18506
diff changeset
    55
15c6eb0a51bd context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 18506
diff changeset
    56
Test that hg cat does not do anything wrong the working copy has 'b' as a symlink (issue4749)
15c6eb0a51bd context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 18506
diff changeset
    57
15c6eb0a51bd context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 18506
diff changeset
    58
  $ hg up 'desc(symlink)'
15c6eb0a51bd context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 18506
diff changeset
    59
  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
15c6eb0a51bd context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 18506
diff changeset
    60
  $ hg cat b/a
15c6eb0a51bd context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 18506
diff changeset
    61
  b/a: no such file in rev bc151a1f53bd
15c6eb0a51bd context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 18506
diff changeset
    62
  [1]
15c6eb0a51bd context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 18506
diff changeset
    63
  $ hg cat -r "desc(directory)" b/a
15c6eb0a51bd context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 18506
diff changeset
    64
  c
15c6eb0a51bd context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 18506
diff changeset
    65
  $ hg cat -r "desc(symlink)" b/a
15c6eb0a51bd context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 18506
diff changeset
    66
  b/a: no such file in rev bc151a1f53bd
15c6eb0a51bd context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 18506
diff changeset
    67
  [1]
15c6eb0a51bd context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 18506
diff changeset
    68
16908
6a997aacba5d tests: convert some 'hghave symlink' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
    69
#endif
6a997aacba5d tests: convert some 'hghave symlink' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
    70
6a997aacba5d tests: convert some 'hghave symlink' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
    71
11855
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    72
unbundle tampered bundle
5158
d316124ebbea Make audit_path more stringent.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    73
11855
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    74
  $ hg init target
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    75
  $ cd target
16350
4f795f5fbb0b tests: make tests work if directory contains special characters
Thomas Arendsen Hein <thomas@intevation.de>
parents: 15521
diff changeset
    76
  $ hg unbundle "$TESTDIR/bundles/tampered.hg"
11855
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    77
  adding changesets
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    78
  adding manifests
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    79
  adding file changes
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    80
  added 5 changesets with 6 changes to 6 files (+4 heads)
34661
eb586ed5d8ce transaction-summary: show the range of new revisions upon pull/unbundle (BC)
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 34555
diff changeset
    81
  new changesets b7da9bf6b037:fc1393d727bc
11855
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    82
  (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
    83
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    84
attack .hg/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 -r0
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    87
  .hg/test
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    88
  $ hg update -Cr0
16908
6a997aacba5d tests: convert some 'hghave symlink' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
    89
  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
    90
  [255]
7554
11a4eb81fb4f test-audit-path: add more tests (issue 1450)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5158
diff changeset
    91
11855
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    92
attack foo/.hg/test
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    93
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    94
  $ hg manifest -r1
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    95
  foo/.hg/test
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    96
  $ hg update -Cr1
16908
6a997aacba5d tests: convert some 'hghave symlink' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
    97
  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
    98
  [255]
7554
11a4eb81fb4f test-audit-path: add more tests (issue 1450)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5158
diff changeset
    99
11855
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
   100
attack back/test where back symlinks to ..
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
   101
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
   102
  $ hg manifest -r2
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
   103
  back
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
   104
  back/test
16908
6a997aacba5d tests: convert some 'hghave symlink' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
   105
#if symlink
11855
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
   106
  $ hg update -Cr2
34555
989e884d1be9 merge: check for path conflicts when merging (issue5628)
Mark Thomas <mbthomas@fb.com>
parents: 33633
diff changeset
   107
  back: is both a file and a directory
989e884d1be9 merge: check for path conflicts when merging (issue5628)
Mark Thomas <mbthomas@fb.com>
parents: 33633
diff changeset
   108
  abort: destination manifest contains path conflicts
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 11855
diff changeset
   109
  [255]
16908
6a997aacba5d tests: convert some 'hghave symlink' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
   110
#else
6a997aacba5d tests: convert some 'hghave symlink' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
   111
('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
   112
  $ hg update -Cr2
6a997aacba5d tests: convert some 'hghave symlink' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
   113
  abort: * (glob)
6a997aacba5d tests: convert some 'hghave symlink' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
   114
  [255]
6a997aacba5d tests: convert some 'hghave symlink' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
   115
#endif
11855
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
   116
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
   117
attack ../test
7554
11a4eb81fb4f test-audit-path: add more tests (issue 1450)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5158
diff changeset
   118
11855
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
   119
  $ hg manifest -r3
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
   120
  ../test
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
   121
  $ hg update -Cr3
16908
6a997aacba5d tests: convert some 'hghave symlink' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
   122
  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
   123
  [255]
11855
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
   124
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
   125
attack /tmp/test
7554
11a4eb81fb4f test-audit-path: add more tests (issue 1450)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5158
diff changeset
   126
11855
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
   127
  $ hg manifest -r4
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
   128
  /tmp/test
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
   129
  $ hg update -Cr4
18506
ef60083b5536 tests: fix for windows - slashes and no serve
Mads Kiilerich <madski@unity3d.com>
parents: 18336
diff changeset
   130
  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
   131
  [255]
16913
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 16908
diff changeset
   132
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 16908
diff changeset
   133
  $ cd ..
33632
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   134
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   135
Test symlink traversal on merge:
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   136
--------------------------------
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   137
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   138
#if symlink
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   139
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   140
set up symlink hell
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   141
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   142
  $ mkdir merge-symlink-out
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   143
  $ hg init merge-symlink
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   144
  $ cd merge-symlink
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   145
  $ touch base
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   146
  $ hg commit -qAm base
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   147
  $ ln -s ../merge-symlink-out a
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   148
  $ hg commit -qAm 'symlink a -> ../merge-symlink-out'
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   149
  $ hg up -q 0
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   150
  $ mkdir a
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   151
  $ touch a/poisoned
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   152
  $ hg commit -qAm 'file a/poisoned'
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   153
  $ hg log -G -T '{rev}: {desc}\n'
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   154
  @  2: file a/poisoned
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   155
  |
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   156
  | o  1: symlink a -> ../merge-symlink-out
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   157
  |/
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   158
  o  0: base
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   159
  
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   160
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   161
try trivial merge
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   162
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   163
  $ hg up -qC 1
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   164
  $ hg merge 2
34555
989e884d1be9 merge: check for path conflicts when merging (issue5628)
Mark Thomas <mbthomas@fb.com>
parents: 33633
diff changeset
   165
  a: path conflict - a file or link has the same name as a directory
989e884d1be9 merge: check for path conflicts when merging (issue5628)
Mark Thomas <mbthomas@fb.com>
parents: 33633
diff changeset
   166
  the local file has been renamed to a~aa04623eb0c3
989e884d1be9 merge: check for path conflicts when merging (issue5628)
Mark Thomas <mbthomas@fb.com>
parents: 33633
diff changeset
   167
  resolve manually then use 'hg resolve --mark a'
989e884d1be9 merge: check for path conflicts when merging (issue5628)
Mark Thomas <mbthomas@fb.com>
parents: 33633
diff changeset
   168
  1 files updated, 0 files merged, 0 files removed, 1 files unresolved
989e884d1be9 merge: check for path conflicts when merging (issue5628)
Mark Thomas <mbthomas@fb.com>
parents: 33633
diff changeset
   169
  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
989e884d1be9 merge: check for path conflicts when merging (issue5628)
Mark Thomas <mbthomas@fb.com>
parents: 33633
diff changeset
   170
  [1]
33632
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   171
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   172
try rebase onto other revision: cache of audited paths should be discarded,
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   173
and the rebase should fail (issue5628)
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   174
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   175
  $ hg up -qC 2
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   176
  $ hg rebase -s 2 -d 1 --config extensions.rebase=
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   177
  rebasing 2:e73c21d6b244 "file a/poisoned" (tip)
34555
989e884d1be9 merge: check for path conflicts when merging (issue5628)
Mark Thomas <mbthomas@fb.com>
parents: 33633
diff changeset
   178
  a: path conflict - a file or link has the same name as a directory
989e884d1be9 merge: check for path conflicts when merging (issue5628)
Mark Thomas <mbthomas@fb.com>
parents: 33633
diff changeset
   179
  the local file has been renamed to a~aa04623eb0c3
989e884d1be9 merge: check for path conflicts when merging (issue5628)
Mark Thomas <mbthomas@fb.com>
parents: 33633
diff changeset
   180
  resolve manually then use 'hg resolve --mark a'
989e884d1be9 merge: check for path conflicts when merging (issue5628)
Mark Thomas <mbthomas@fb.com>
parents: 33633
diff changeset
   181
  unresolved conflicts (see hg resolve, then hg rebase --continue)
989e884d1be9 merge: check for path conflicts when merging (issue5628)
Mark Thomas <mbthomas@fb.com>
parents: 33633
diff changeset
   182
  [1]
33632
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   183
  $ ls ../merge-symlink-out
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   184
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   185
  $ cd ..
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   186
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   187
Test symlink traversal on update:
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   188
---------------------------------
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   189
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   190
  $ mkdir update-symlink-out
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   191
  $ hg init update-symlink
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   192
  $ cd update-symlink
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   193
  $ ln -s ../update-symlink-out a
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   194
  $ hg commit -qAm 'symlink a -> ../update-symlink-out'
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   195
  $ hg rm a
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   196
  $ mkdir a && touch a/b
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   197
  $ hg ci -qAm 'file a/b' a/b
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   198
  $ hg up -qC 0
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   199
  $ hg rm a
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   200
  $ mkdir a && touch a/c
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   201
  $ hg ci -qAm 'rm a, file a/c'
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   202
  $ hg log -G -T '{rev}: {desc}\n'
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   203
  @  2: rm a, file a/c
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   204
  |
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   205
  | o  1: file a/b
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   206
  |/
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   207
  o  0: symlink a -> ../update-symlink-out
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   208
  
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   209
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   210
try linear update where symlink already exists:
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   211
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   212
  $ hg up -qC 0
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   213
  $ hg up 1
34555
989e884d1be9 merge: check for path conflicts when merging (issue5628)
Mark Thomas <mbthomas@fb.com>
parents: 33633
diff changeset
   214
  a: is both a file and a directory
989e884d1be9 merge: check for path conflicts when merging (issue5628)
Mark Thomas <mbthomas@fb.com>
parents: 33633
diff changeset
   215
  abort: destination manifest contains path conflicts
33632
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   216
  [255]
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   217
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   218
try linear update including symlinked directory and its content: paths are
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   219
audited first by calculateupdates(), where no symlink is created so both
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   220
'a' and 'a/b' are taken as good paths. still applyupdates() should fail.
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   221
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   222
  $ hg up -qC null
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   223
  $ hg up 1
34555
989e884d1be9 merge: check for path conflicts when merging (issue5628)
Mark Thomas <mbthomas@fb.com>
parents: 33633
diff changeset
   224
  a: is both a file and a directory
989e884d1be9 merge: check for path conflicts when merging (issue5628)
Mark Thomas <mbthomas@fb.com>
parents: 33633
diff changeset
   225
  abort: destination manifest contains path conflicts
33633
20bac46f7744 pathauditor: disable cache of audited paths by default (issue5628)
Yuya Nishihara <yuya@tcha.org>
parents: 33632
diff changeset
   226
  [255]
33632
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   227
  $ ls ../update-symlink-out
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   228
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   229
try branch update replacing directory with symlink, and its content: the
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   230
path 'a' is audited as a directory first, which should be audited again as
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   231
a symlink.
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   232
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   233
  $ rm -f a
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   234
  $ hg up -qC 2
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   235
  $ hg up 1
34555
989e884d1be9 merge: check for path conflicts when merging (issue5628)
Mark Thomas <mbthomas@fb.com>
parents: 33633
diff changeset
   236
  a: is both a file and a directory
989e884d1be9 merge: check for path conflicts when merging (issue5628)
Mark Thomas <mbthomas@fb.com>
parents: 33633
diff changeset
   237
  abort: destination manifest contains path conflicts
33633
20bac46f7744 pathauditor: disable cache of audited paths by default (issue5628)
Yuya Nishihara <yuya@tcha.org>
parents: 33632
diff changeset
   238
  [255]
33632
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   239
  $ ls ../update-symlink-out
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   240
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   241
  $ cd ..
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   242
0134d839444b tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents: 27234
diff changeset
   243
#endif