tests/test-audit-subrepo.t
author Yuya Nishihara <yuya@tcha.org>
Tue, 08 Jan 2019 21:51:54 +0900
branchstable
changeset 41456 31286c9282df
parent 35393 4441705b7111
child 41457 6c10eba6b9cd
permissions -rw-r--r--
subrepo: extend path auditing test to include more weird patterns (SEC) While reviewing patches for the issue 5739, "$foo in repository path expanded", I realized that subrepo paths can also be cheated. This patch includes various subrepo paths which are potentially unsafe. Since an expanded subrepo path isn't audited, this bug allows symlink check bypass. As a result, a malicious subrepository could be checked out to a sub tree of e.g. $HOME directory. The good news is that the destination directory must be empty or nonexistent, so the existing ~/.bashrc wouldn't be overwritten. See the last part of the tests for details.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
34983
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
     1
Test illegal name
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
     2
-----------------
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
     3
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
     4
on commit:
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
     5
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
     6
  $ hg init hgname
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
     7
  $ cd hgname
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
     8
  $ mkdir sub
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
     9
  $ hg init sub/.hg
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    10
  $ echo 'sub/.hg = sub/.hg' >> .hgsub
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    11
  $ hg ci -qAm 'add subrepo "sub/.hg"'
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 35166
diff changeset
    12
  abort: path 'sub/.hg' is inside nested repo 'sub'
34983
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    13
  [255]
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    14
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    15
prepare tampered repo (including the commit above):
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    16
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    17
  $ hg import --bypass -qm 'add subrepo "sub/.hg"' - <<'EOF'
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    18
  > diff --git a/.hgsub b/.hgsub
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    19
  > new file mode 100644
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    20
  > --- /dev/null
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    21
  > +++ b/.hgsub
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    22
  > @@ -0,0 +1,1 @@
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    23
  > +sub/.hg = sub/.hg
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    24
  > diff --git a/.hgsubstate b/.hgsubstate
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    25
  > new file mode 100644
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    26
  > --- /dev/null
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    27
  > +++ b/.hgsubstate
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    28
  > @@ -0,0 +1,1 @@
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    29
  > +0000000000000000000000000000000000000000 sub/.hg
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    30
  > EOF
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    31
  $ cd ..
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    32
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    33
on clone (and update):
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    34
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    35
  $ hg clone -q hgname hgname2
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 35166
diff changeset
    36
  abort: path 'sub/.hg' is inside nested repo 'sub'
34983
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    37
  [255]
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    38
41456
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    39
Test absolute path
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    40
------------------
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    41
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    42
on commit:
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    43
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    44
  $ hg init absolutepath
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    45
  $ cd absolutepath
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    46
  $ hg init sub
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    47
  $ echo '/sub = sub' >> .hgsub
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    48
  $ hg ci -qAm 'add subrepo "/sub"'
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    49
  abort: path contains illegal component: /sub
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    50
  [255]
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    51
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    52
prepare tampered repo (including the commit above):
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    53
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    54
  $ hg import --bypass -qm 'add subrepo "/sub"' - <<'EOF'
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    55
  > diff --git a/.hgsub b/.hgsub
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    56
  > new file mode 100644
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    57
  > --- /dev/null
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    58
  > +++ b/.hgsub
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    59
  > @@ -0,0 +1,1 @@
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    60
  > +/sub = sub
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    61
  > diff --git a/.hgsubstate b/.hgsubstate
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    62
  > new file mode 100644
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    63
  > --- /dev/null
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    64
  > +++ b/.hgsubstate
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    65
  > @@ -0,0 +1,1 @@
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    66
  > +0000000000000000000000000000000000000000 /sub
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    67
  > EOF
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    68
  $ cd ..
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    69
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    70
on clone (and update):
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    71
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    72
  $ hg clone -q absolutepath absolutepath2
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    73
  abort: path contains illegal component: /sub
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    74
  [255]
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    75
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    76
Test root path
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    77
--------------
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    78
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    79
on commit:
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    80
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    81
  $ hg init rootpath
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    82
  $ cd rootpath
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    83
  $ hg init sub
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    84
  $ echo '/ = sub' >> .hgsub
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    85
  $ hg ci -qAm 'add subrepo "/"'
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    86
  abort: path ends in directory separator: /
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    87
  [255]
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    88
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    89
prepare tampered repo (including the commit above):
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    90
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    91
  $ hg import --bypass -qm 'add subrepo "/"' - <<'EOF'
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    92
  > diff --git a/.hgsub b/.hgsub
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    93
  > new file mode 100644
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    94
  > --- /dev/null
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    95
  > +++ b/.hgsub
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    96
  > @@ -0,0 +1,1 @@
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    97
  > +/ = sub
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    98
  > diff --git a/.hgsubstate b/.hgsubstate
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    99
  > new file mode 100644
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   100
  > --- /dev/null
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   101
  > +++ b/.hgsubstate
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   102
  > @@ -0,0 +1,1 @@
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   103
  > +0000000000000000000000000000000000000000 /
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   104
  > EOF
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   105
  $ cd ..
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   106
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   107
on clone (and update):
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   108
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   109
  $ hg clone -q rootpath rootpath2
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   110
  abort: path ends in directory separator: /
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   111
  [255]
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   112
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   113
Test empty path
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   114
---------------
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   115
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   116
on commit:
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   117
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   118
  $ hg init emptypath
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   119
  $ cd emptypath
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   120
  $ hg init sub
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   121
  $ echo '= sub' >> .hgsub
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   122
  $ hg ci -qAm 'add subrepo ""'
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   123
  hg: parse error at .hgsub:1: = sub
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   124
  [255]
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   125
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   126
prepare tampered repo (including the commit above):
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   127
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   128
  $ hg import --bypass -qm 'add subrepo ""' - <<'EOF'
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   129
  > diff --git a/.hgsub b/.hgsub
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   130
  > new file mode 100644
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   131
  > --- /dev/null
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   132
  > +++ b/.hgsub
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   133
  > @@ -0,0 +1,1 @@
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   134
  > += sub
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   135
  > diff --git a/.hgsubstate b/.hgsubstate
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   136
  > new file mode 100644
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   137
  > --- /dev/null
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   138
  > +++ b/.hgsubstate
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   139
  > @@ -0,0 +1,1 @@
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   140
  > +0000000000000000000000000000000000000000
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   141
  > EOF
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   142
  $ cd ..
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   143
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   144
on clone (and update):
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   145
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   146
  $ hg clone -q emptypath emptypath2
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   147
  hg: parse error at .hgsub:1: = sub
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   148
  [255]
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   149
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   150
Test current path
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   151
-----------------
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   152
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   153
on commit:
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   154
BROKEN: should fail
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   155
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   156
  $ hg init currentpath
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   157
  $ cd currentpath
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   158
  $ hg init sub
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   159
  $ echo '. = sub' >> .hgsub
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   160
  $ hg ci -qAm 'add subrepo "."'
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   161
  $ cd ..
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   162
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   163
on clone (and update):
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   164
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   165
  $ hg clone -q currentpath currentpath2 --config ui.timeout=1
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   166
  waiting for lock on working directory of $TESTTMP/currentpath2/. * (glob)
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   167
  abort: working directory of $TESTTMP/currentpath2/.: timed out waiting for lock held by '*' (glob)
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   168
  [255]
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   169
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   170
Test outer path
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   171
---------------
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   172
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   173
on commit:
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   174
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   175
  $ mkdir outerpath
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   176
  $ cd outerpath
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   177
  $ hg init main
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   178
  $ cd main
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   179
  $ hg init ../sub
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   180
  $ echo '../sub = ../sub' >> .hgsub
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   181
  $ hg ci -qAm 'add subrepo "../sub"'
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   182
  abort: path contains illegal component: ../sub
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   183
  [255]
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   184
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   185
prepare tampered repo (including the commit above):
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   186
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   187
  $ hg import --bypass -qm 'add subrepo "../sub"' - <<'EOF'
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   188
  > diff --git a/.hgsub b/.hgsub
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   189
  > new file mode 100644
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   190
  > --- /dev/null
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   191
  > +++ b/.hgsub
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   192
  > @@ -0,0 +1,1 @@
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   193
  > +../sub = ../sub
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   194
  > diff --git a/.hgsubstate b/.hgsubstate
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   195
  > new file mode 100644
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   196
  > --- /dev/null
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   197
  > +++ b/.hgsubstate
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   198
  > @@ -0,0 +1,1 @@
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   199
  > +0000000000000000000000000000000000000000 ../sub
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   200
  > EOF
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   201
  $ cd ..
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   202
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   203
on clone (and update):
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   204
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   205
  $ hg clone -q main main2
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   206
  abort: path contains illegal component: ../sub
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   207
  [255]
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   208
  $ cd ..
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   209
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   210
Test variable expansion
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   211
-----------------------
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   212
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   213
Subrepository paths shouldn't be expanded, but we fail to handle them
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   214
properly. Any local repository paths are expanded.
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   215
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   216
on commit:
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   217
BROKEN: wrong error message
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   218
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   219
  $ mkdir envvar
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   220
  $ cd envvar
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   221
  $ hg init main
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   222
  $ cd main
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   223
  $ hg init sub1
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   224
  $ cat <<'EOF' > sub1/hgrc
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   225
  > [hooks]
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   226
  > log = echo pwned
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   227
  > EOF
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   228
  $ hg -R sub1 ci -qAm 'add sub1 files'
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   229
  $ hg -R sub1 log -r. -T '{node}\n'
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   230
  39eb4b4d3e096527668784893a9280578a8f38b8
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   231
  $ echo '$SUB = sub1' >> .hgsub
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   232
  $ SUB=sub1 hg ci -qAm 'add subrepo "$SUB"'
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   233
  abort: repository $TESTTMP/envvar/main/$SUB already exists!
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   234
  [255]
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   235
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   236
prepare tampered repo (including the changes above as two commits):
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   237
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   238
  $ hg import --bypass -qm 'add subrepo "$SUB"' - <<'EOF'
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   239
  > diff --git a/.hgsub b/.hgsub
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   240
  > new file mode 100644
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   241
  > --- /dev/null
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   242
  > +++ b/.hgsub
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   243
  > @@ -0,0 +1,1 @@
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   244
  > +$SUB = sub1
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   245
  > diff --git a/.hgsubstate b/.hgsubstate
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   246
  > new file mode 100644
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   247
  > --- /dev/null
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   248
  > +++ b/.hgsubstate
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   249
  > @@ -0,0 +1,1 @@
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   250
  > +0000000000000000000000000000000000000000 $SUB
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   251
  > EOF
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   252
  $ hg debugsetparents 0
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   253
  $ hg import --bypass -qm 'update subrepo "$SUB"' - <<'EOF'
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   254
  > diff --git a/.hgsubstate b/.hgsubstate
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   255
  > --- a/.hgsubstate
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   256
  > +++ b/.hgsubstate
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   257
  > @@ -1,1 +1,1 @@
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   258
  > -0000000000000000000000000000000000000000 $SUB
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   259
  > +39eb4b4d3e096527668784893a9280578a8f38b8 $SUB
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   260
  > EOF
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   261
  $ cd ..
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   262
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   263
on clone (and update) with various substitutions:
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   264
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   265
  $ hg clone -q main main2
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   266
  $ ls main2
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   267
  $SUB
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   268
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   269
  $ SUB=sub1 hg clone -q main main3
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   270
  $ ls main3
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   271
  sub1
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   272
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   273
  $ SUB=sub2 hg clone -q main main4
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   274
  $ ls main4
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   275
  sub2
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   276
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   277
on clone empty subrepo into .hg, then pull (and update), which at least fails:
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   278
BROKEN: the first clone should fail
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   279
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   280
  $ SUB=.hg hg clone -qr0 main main5
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   281
  $ ls main5
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   282
  $ ls -d main5/.hg/.hg
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   283
  main5/.hg/.hg
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   284
  $ SUB=.hg hg -R main5 pull -u
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   285
  pulling from $TESTTMP/envvar/main
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   286
  searching for changes
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   287
  adding changesets
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   288
  adding manifests
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   289
  adding file changes
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   290
  added 1 changesets with 1 changes to 1 files
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   291
  new changesets 7a2f0e59146f
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   292
  abort: repository $TESTTMP/envvar/main5/$SUB already exists!
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   293
  [255]
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   294
  $ cat main5/.hg/hgrc | grep pwned
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   295
  [1]
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   296
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   297
on clone (and update) into .hg, which at least fails:
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   298
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   299
  $ SUB=.hg hg clone -q main main6
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   300
  abort: destination '$TESTTMP/envvar/main6/.hg' is not empty (in subrepository ".hg")
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   301
  [255]
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   302
  $ ls main6
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   303
  $ cat main6/.hg/hgrc | grep pwned
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   304
  [1]
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   305
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   306
on clone (and update) into .hg/* subdir:
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   307
BROKEN: should fail
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   308
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   309
  $ SUB=.hg/foo hg clone -q main main7
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   310
  $ ls main7
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   311
  $ ls main7/.hg/foo
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   312
  hgrc
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   313
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   314
on clone (and update) into outer tree:
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   315
BROKEN: should fail
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   316
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   317
  $ SUB=../out-of-tree-write hg clone -q main main8
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   318
  $ ls main8
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   319
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   320
on clone (and update) into e.g. $HOME, which doesn't work since subrepo paths
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   321
are concatenated prior to variable expansion:
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   322
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   323
  $ SUB="$TESTTMP/envvar/fakehome" hg clone -q main main9
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   324
  $ ls main9 | wc -l
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   325
  \s*1 (re)
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   326
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   327
  $ ls
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   328
  main
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   329
  main2
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   330
  main3
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   331
  main4
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   332
  main5
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   333
  main6
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   334
  main7
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   335
  main8
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   336
  main9
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   337
  out-of-tree-write
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   338
  $ cd ..
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   339
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   340
Test tilde
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   341
----------
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   342
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   343
The leading tilde may be expanded to $HOME, but it's a valid subrepo path.
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   344
However, we might want to prohibit it as it seems potentially unsafe.
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   345
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   346
on commit:
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   347
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   348
  $ hg init tilde
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   349
  $ cd tilde
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   350
  $ hg init './~'
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   351
  $ echo '~ = ~' >> .hgsub
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   352
  $ hg ci -qAm 'add subrepo "~"'
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   353
  $ ls
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   354
  ~
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   355
  $ cd ..
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   356
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   357
on clone (and update):
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   358
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   359
  $ hg clone -q tilde tilde2
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   360
  $ ls tilde2
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   361
  ~
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   362
34983
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   363
Test direct symlink traversal
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   364
-----------------------------
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   365
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   366
#if symlink
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   367
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   368
on commit:
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   369
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   370
  $ mkdir hgsymdir
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   371
  $ hg init hgsymdir/root
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   372
  $ cd hgsymdir/root
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   373
  $ ln -s ../out
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   374
  $ hg ci -qAm 'add symlink "out"'
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   375
  $ hg init ../out
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   376
  $ echo 'out = out' >> .hgsub
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   377
  $ hg ci -qAm 'add subrepo "out"'
34984
071cbeba4212 subrepo: disallow symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 34983
diff changeset
   378
  abort: subrepo 'out' traverses symbolic link
071cbeba4212 subrepo: disallow symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 34983
diff changeset
   379
  [255]
071cbeba4212 subrepo: disallow symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 34983
diff changeset
   380
071cbeba4212 subrepo: disallow symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 34983
diff changeset
   381
prepare tampered repo (including the commit above):
071cbeba4212 subrepo: disallow symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 34983
diff changeset
   382
071cbeba4212 subrepo: disallow symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 34983
diff changeset
   383
  $ hg import --bypass -qm 'add subrepo "out"' - <<'EOF'
071cbeba4212 subrepo: disallow symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 34983
diff changeset
   384
  > diff --git a/.hgsub b/.hgsub
071cbeba4212 subrepo: disallow symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 34983
diff changeset
   385
  > new file mode 100644
071cbeba4212 subrepo: disallow symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 34983
diff changeset
   386
  > --- /dev/null
071cbeba4212 subrepo: disallow symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 34983
diff changeset
   387
  > +++ b/.hgsub
071cbeba4212 subrepo: disallow symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 34983
diff changeset
   388
  > @@ -0,0 +1,1 @@
071cbeba4212 subrepo: disallow symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 34983
diff changeset
   389
  > +out = out
071cbeba4212 subrepo: disallow symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 34983
diff changeset
   390
  > diff --git a/.hgsubstate b/.hgsubstate
071cbeba4212 subrepo: disallow symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 34983
diff changeset
   391
  > new file mode 100644
071cbeba4212 subrepo: disallow symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 34983
diff changeset
   392
  > --- /dev/null
071cbeba4212 subrepo: disallow symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 34983
diff changeset
   393
  > +++ b/.hgsubstate
071cbeba4212 subrepo: disallow symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 34983
diff changeset
   394
  > @@ -0,0 +1,1 @@
071cbeba4212 subrepo: disallow symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 34983
diff changeset
   395
  > +0000000000000000000000000000000000000000 out
071cbeba4212 subrepo: disallow symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 34983
diff changeset
   396
  > EOF
34983
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   397
  $ cd ../..
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   398
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   399
on clone (and update):
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   400
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   401
  $ mkdir hgsymdir2
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   402
  $ hg clone -q hgsymdir/root hgsymdir2/root
34984
071cbeba4212 subrepo: disallow symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 34983
diff changeset
   403
  abort: subrepo 'out' traverses symbolic link
071cbeba4212 subrepo: disallow symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 34983
diff changeset
   404
  [255]
34983
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   405
  $ ls hgsymdir2
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   406
  root
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   407
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   408
#endif
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   409
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   410
Test indirect symlink traversal
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   411
-------------------------------
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   412
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   413
#if symlink
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   414
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   415
on commit:
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   416
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   417
  $ mkdir hgsymin
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   418
  $ hg init hgsymin/root
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   419
  $ cd hgsymin/root
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   420
  $ ln -s ../out
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   421
  $ hg ci -qAm 'add symlink "out"'
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   422
  $ mkdir ../out
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   423
  $ hg init ../out/sub
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   424
  $ echo 'out/sub = out/sub' >> .hgsub
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   425
  $ hg ci -qAm 'add subrepo "out/sub"'
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   426
  abort: path 'out/sub' traverses symbolic link 'out'
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   427
  [255]
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   428
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   429
prepare tampered repo (including the commit above):
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   430
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   431
  $ hg import --bypass -qm 'add subrepo "out/sub"' - <<'EOF'
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   432
  > diff --git a/.hgsub b/.hgsub
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   433
  > new file mode 100644
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   434
  > --- /dev/null
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   435
  > +++ b/.hgsub
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   436
  > @@ -0,0 +1,1 @@
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   437
  > +out/sub = out/sub
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   438
  > diff --git a/.hgsubstate b/.hgsubstate
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   439
  > new file mode 100644
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   440
  > --- /dev/null
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   441
  > +++ b/.hgsubstate
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   442
  > @@ -0,0 +1,1 @@
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   443
  > +0000000000000000000000000000000000000000 out/sub
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   444
  > EOF
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   445
  $ cd ../..
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   446
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   447
on clone (and update):
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   448
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   449
  $ mkdir hgsymin2
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   450
  $ hg clone -q hgsymin/root hgsymin2/root
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   451
  abort: path 'out/sub' traverses symbolic link 'out'
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   452
  [255]
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   453
  $ ls hgsymin2
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   454
  root
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   455
80d7dbda9294 tests: show symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   456
#endif
41456
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   457
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   458
Test symlink traversal by variable expansion
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   459
--------------------------------------------
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   460
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   461
#if symlink
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   462
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   463
  $ FAKEHOME="$TESTTMP/envvarsym/fakehome"
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   464
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   465
on commit:
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   466
BROKEN: wrong error message
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   467
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   468
  $ mkdir envvarsym
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   469
  $ cd envvarsym
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   470
  $ hg init main
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   471
  $ cd main
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   472
  $ ln -s "`echo "$FAKEHOME" | sed 's|\(.\)/.*|\1|'`"
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   473
  $ hg ci -qAm 'add symlink to top-level system directory'
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   474
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   475
  $ hg init sub1
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   476
  $ echo pwned > sub1/pwned
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   477
  $ hg -R sub1 ci -qAm 'add sub1 files'
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   478
  $ hg -R sub1 log -r. -T '{node}\n'
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   479
  f40c9134ba1b6961e12f250868823f0092fb68a8
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   480
  $ echo '$SUB = sub1' >> .hgsub
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   481
  $ SUB="$FAKEHOME" hg ci -qAm 'add subrepo "$SUB"'
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   482
  abort: repository $TESTTMP/envvarsym/main/$SUB already exists!
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   483
  [255]
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   484
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   485
prepare tampered repo (including the changes above as two commits):
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   486
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   487
  $ hg import --bypass -qm 'add subrepo "$SUB"' - <<'EOF'
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   488
  > diff --git a/.hgsub b/.hgsub
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   489
  > new file mode 100644
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   490
  > --- /dev/null
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   491
  > +++ b/.hgsub
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   492
  > @@ -0,0 +1,1 @@
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   493
  > +$SUB = sub1
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   494
  > diff --git a/.hgsubstate b/.hgsubstate
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   495
  > new file mode 100644
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   496
  > --- /dev/null
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   497
  > +++ b/.hgsubstate
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   498
  > @@ -0,0 +1,1 @@
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   499
  > +0000000000000000000000000000000000000000 $SUB
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   500
  > EOF
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   501
  $ hg debugsetparents 1
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   502
  $ hg import --bypass -qm 'update subrepo "$SUB"' - <<'EOF'
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   503
  > diff --git a/.hgsubstate b/.hgsubstate
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   504
  > --- a/.hgsubstate
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   505
  > +++ b/.hgsubstate
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   506
  > @@ -1,1 +1,1 @@
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   507
  > -0000000000000000000000000000000000000000 $SUB
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   508
  > +f40c9134ba1b6961e12f250868823f0092fb68a8 $SUB
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   509
  > EOF
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   510
  $ cd ..
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   511
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   512
on clone (and update) without fakehome directory:
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   513
BROKEN: should fail
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   514
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   515
  $ rm -fR "$FAKEHOME"
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   516
  $ SUB="$FAKEHOME" hg clone -q main main2
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   517
  $ ls "$FAKEHOME"
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   518
  pwned
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   519
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   520
on clone (and update) with empty fakehome directory:
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   521
BROKEN: should fail
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   522
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   523
  $ rm -fR "$FAKEHOME"
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   524
  $ mkdir "$FAKEHOME"
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   525
  $ SUB="$FAKEHOME" hg clone -q main main3
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   526
  $ ls "$FAKEHOME"
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   527
  pwned
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   528
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   529
on clone (and update) with non-empty fakehome directory:
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   530
BROKEN: wrong error message
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   531
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   532
  $ rm -fR "$FAKEHOME"
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   533
  $ mkdir "$FAKEHOME"
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   534
  $ touch "$FAKEHOME/a"
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   535
  $ SUB="$FAKEHOME" hg clone -q main main4
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   536
  abort: destination '$TESTTMP/envvarsym/fakehome' is not empty (in subrepository "*") (glob)
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   537
  [255]
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   538
  $ ls "$FAKEHOME"
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   539
  a
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   540
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   541
on clone empty subrepo with non-empty fakehome directory,
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   542
then pull (and update):
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   543
BROKEN: the first clone should fail
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   544
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   545
  $ rm -fR "$FAKEHOME"
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   546
  $ mkdir "$FAKEHOME"
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   547
  $ touch "$FAKEHOME/a"
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   548
  $ SUB="$FAKEHOME" hg clone -qr1 main main5
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   549
  $ ls "$FAKEHOME"
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   550
  a
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   551
  $ ls -d "$FAKEHOME/.hg"
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   552
  $TESTTMP/envvarsym/fakehome/.hg
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   553
  $ SUB="$FAKEHOME" hg -R main5 pull -u
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   554
  pulling from $TESTTMP/envvarsym/main
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   555
  searching for changes
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   556
  adding changesets
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   557
  adding manifests
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   558
  adding file changes
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   559
  added 1 changesets with 1 changes to 1 files
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   560
  new changesets * (glob)
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   561
  abort: repository $TESTTMP/envvarsym/main5/$SUB already exists!
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   562
  [255]
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   563
  $ ls "$FAKEHOME"
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   564
  a
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   565
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   566
on clone empty subrepo with hg-managed fakehome directory,
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   567
then pull (and update):
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   568
BROKEN: wrong error message
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   569
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   570
  $ rm -fR "$FAKEHOME"
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   571
  $ hg init "$FAKEHOME"
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   572
  $ touch "$FAKEHOME/a"
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   573
  $ hg -R "$FAKEHOME" ci -qAm 'add fakehome file'
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   574
  $ SUB="$FAKEHOME" hg clone -qr1 main main6
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   575
  abort: repository $TESTTMP/envvarsym/main6/$SUB already exists!
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   576
  [255]
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   577
  $ ls "$FAKEHOME"
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   578
  a
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   579
  $ SUB="$FAKEHOME" hg -R main6 pull -u
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   580
  pulling from $TESTTMP/envvarsym/main
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   581
  searching for changes
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   582
  adding changesets
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   583
  adding manifests
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   584
  adding file changes
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   585
  added 1 changesets with 1 changes to 1 files
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   586
  new changesets * (glob)
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   587
  .hgsubstate: untracked file differs
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   588
  abort: untracked files in working directory differ from files in requested revision
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   589
  [255]
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   590
  $ ls "$FAKEHOME"
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   591
  a
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   592
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   593
on clone only symlink with hg-managed fakehome directory,
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   594
then pull (and update):
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   595
BROKEN: wrong error message
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   596
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   597
  $ rm -fR "$FAKEHOME"
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   598
  $ hg init "$FAKEHOME"
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   599
  $ touch "$FAKEHOME/a"
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   600
  $ hg -R "$FAKEHOME" ci -qAm 'add fakehome file'
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   601
  $ SUB="$FAKEHOME" hg clone -qr0 main main7
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   602
  $ ls "$FAKEHOME"
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   603
  a
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   604
  $ SUB="$FAKEHOME" hg -R main7 pull -uf
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   605
  pulling from $TESTTMP/envvarsym/main
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   606
  searching for changes
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   607
  adding changesets
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   608
  adding manifests
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   609
  adding file changes
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   610
  added 2 changesets with 3 changes to 2 files
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   611
  new changesets * (glob)
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   612
  abort: repository $TESTTMP/envvarsym/main7/$SUB already exists!
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   613
  [255]
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   614
  $ ls "$FAKEHOME"
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   615
  a
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   616
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   617
  $ cd ..
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   618
31286c9282df subrepo: extend path auditing test to include more weird patterns (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
   619
#endif