tests/test-permissions.t
author Brodie Rao <brodie@bitheap.org>
Wed, 22 Sep 2010 16:06:00 -0500
changeset 12375 02990e22150b
parent 12365 22f3353bcc36
child 12376 97ffc68f71d3
permissions -rw-r--r--
tests: require regexes in unified tests to be marked with " (re)" Consider this test: $ hg glog --template '{rev}:{node|short} "{desc}"\n' @ 2:20c4f79fd7ac "3" | | o 1:38f24201dcab "2" |/ o 0:2a18120dc1c9 "1" Because each line beginning with "|" can be compiled as a regular expression (equivalent to ".*|"), they will match any output. Similarly: $ echo foo The blank output line can be compiled as a regular expression and will also match any output. With this patch, none of the above output lines will be matched as regular expressions. A line must end in " (re)" in order to be matched as one. Lines are still matched literally first, so the following will pass: $ echo 'foo (re)' foo (re)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
     1
  $ hg init t
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
     2
  $ cd t
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
     3
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
     4
  $ echo foo > a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
     5
  $ hg add a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
     6
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
     7
  $ hg commit -m "1"
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
     8
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
     9
  $ hg verify
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    10
  checking changesets
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    11
  checking manifests
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    12
  crosschecking files in changesets and manifests
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    13
  checking files
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    14
  1 files, 1 changesets, 1 total revisions
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    15
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    16
  $ chmod -r .hg/store/data/a.i
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    17
12365
22f3353bcc36 tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents: 12279
diff changeset
    18
  $ hg verify
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    19
  checking changesets
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    20
  checking manifests
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    21
  crosschecking files in changesets and manifests
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    22
  checking files
12375
02990e22150b tests: require regexes in unified tests to be marked with " (re)"
Brodie Rao <brodie@bitheap.org>
parents: 12365
diff changeset
    23
  abort: Permission denied: .* (re)
12365
22f3353bcc36 tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents: 12279
diff changeset
    24
  [255]
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    25
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    26
  $ chmod +r .hg/store/data/a.i
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    27
12365
22f3353bcc36 tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents: 12279
diff changeset
    28
  $ hg verify
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    29
  checking changesets
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    30
  checking manifests
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    31
  crosschecking files in changesets and manifests
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    32
  checking files
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    33
  1 files, 1 changesets, 1 total revisions
1497
f0b13c019b04 Add permissions handling test
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    34
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    35
  $ chmod -w .hg/store/data/a.i
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    36
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    37
  $ echo barber > a
12365
22f3353bcc36 tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents: 12279
diff changeset
    38
  $ hg commit -m "2"
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    39
  trouble committing a!
12375
02990e22150b tests: require regexes in unified tests to be marked with " (re)"
Brodie Rao <brodie@bitheap.org>
parents: 12365
diff changeset
    40
  abort: Permission denied: .* (re)
12365
22f3353bcc36 tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents: 12279
diff changeset
    41
  [255]
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    42
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    43
  $ chmod -w .
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    44
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    45
  $ hg diff --nodates
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    46
  diff -r 2a18120dc1c9 a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    47
  --- a/a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    48
  +++ b/a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    49
  @@ -1,1 +1,1 @@
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    50
  -foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    51
  +barber
7099
6f750e76fb46 dirstate.walk: skip unreadable directories (issue1213)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 5519
diff changeset
    52
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    53
  $ chmod +w .
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    54
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    55
  $ chmod +w .hg/store/data/a.i
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    56
  $ mkdir dir
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    57
  $ touch dir/a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    58
  $ hg status
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    59
  M a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    60
  ? dir/a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    61
  $ chmod -rx dir
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    62
  $ hg status
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    63
  dir: Permission denied
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    64
  M a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    65
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    66
Reenable perm to allow deletion:
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    67
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    68
  $ chmod +rx dir
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    69