tests/test-status.t
author Matt Mackall <mpm@selenic.com>
Sun, 23 Oct 2011 16:32:27 -0500
branchstable
changeset 15348 c681e478c429
parent 14155 921683f14ad7
child 15521 117f9190c1ba
child 15848 012b285cf643
permissions -rw-r--r--
windows: sanity-check symlink placeholders On Windows, we store symlinks as plain files with the link contents. Via user error or NFS/Samba assistance, these files often end up with 'normal' file contents. Committing these changes thus gives an invalid symlink that can't be checked out on Unix. Here we filter out any modified symlink placeholders that look suspicious when computing status: - more than 1K (looks more like a normal file) - contain NULs (not allowed on Unix, probably a binary) - contains \n (filenames can't contain \n, very unusual for symlinks, very common for files)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
11782
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
     1
  $ hg init repo1
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
     2
  $ cd repo1
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
     3
  $ mkdir a b a/1 b/1 b/2
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
     4
  $ touch in_root a/in_a b/in_b a/1/in_a_1 b/1/in_b_1 b/2/in_b_2
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
     5
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
     6
hg status in repo root:
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
     7
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
     8
  $ hg status
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
     9
  ? a/1/in_a_1
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    10
  ? a/in_a
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    11
  ? b/1/in_b_1
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    12
  ? b/2/in_b_2
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    13
  ? b/in_b
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    14
  ? in_root
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    15
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    16
hg status . in repo root:
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    17
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    18
  $ hg status .
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    19
  ? a/1/in_a_1
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    20
  ? a/in_a
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    21
  ? b/1/in_b_1
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    22
  ? b/2/in_b_2
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    23
  ? b/in_b
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    24
  ? in_root
1624
d9e576e55d81 Added test for relative paths and all status flags for 'hg status'
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
    25
11782
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    26
  $ hg status --cwd a
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    27
  ? a/1/in_a_1
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    28
  ? a/in_a
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    29
  ? b/1/in_b_1
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    30
  ? b/2/in_b_2
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    31
  ? b/in_b
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    32
  ? in_root
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    33
  $ hg status --cwd a .
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    34
  ? 1/in_a_1
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    35
  ? in_a
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    36
  $ hg status --cwd a ..
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    37
  ? 1/in_a_1
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    38
  ? in_a
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    39
  ? ../b/1/in_b_1
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    40
  ? ../b/2/in_b_2
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    41
  ? ../b/in_b
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    42
  ? ../in_root
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    43
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    44
  $ hg status --cwd b
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    45
  ? a/1/in_a_1
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    46
  ? a/in_a
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    47
  ? b/1/in_b_1
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    48
  ? b/2/in_b_2
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    49
  ? b/in_b
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    50
  ? in_root
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    51
  $ hg status --cwd b .
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    52
  ? 1/in_b_1
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    53
  ? 2/in_b_2
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    54
  ? in_b
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    55
  $ hg status --cwd b ..
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    56
  ? ../a/1/in_a_1
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    57
  ? ../a/in_a
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    58
  ? 1/in_b_1
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    59
  ? 2/in_b_2
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    60
  ? in_b
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    61
  ? ../in_root
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    62
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    63
  $ hg status --cwd a/1
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    64
  ? a/1/in_a_1
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    65
  ? a/in_a
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    66
  ? b/1/in_b_1
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    67
  ? b/2/in_b_2
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    68
  ? b/in_b
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    69
  ? in_root
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    70
  $ hg status --cwd a/1 .
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    71
  ? in_a_1
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    72
  $ hg status --cwd a/1 ..
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    73
  ? in_a_1
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    74
  ? ../in_a
1624
d9e576e55d81 Added test for relative paths and all status flags for 'hg status'
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
    75
11782
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    76
  $ hg status --cwd b/1
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    77
  ? a/1/in_a_1
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    78
  ? a/in_a
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    79
  ? b/1/in_b_1
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    80
  ? b/2/in_b_2
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    81
  ? b/in_b
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    82
  ? in_root
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    83
  $ hg status --cwd b/1 .
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    84
  ? in_b_1
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    85
  $ hg status --cwd b/1 ..
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    86
  ? in_b_1
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    87
  ? ../2/in_b_2
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    88
  ? ../in_b
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    89
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    90
  $ hg status --cwd b/2
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    91
  ? a/1/in_a_1
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    92
  ? a/in_a
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    93
  ? b/1/in_b_1
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    94
  ? b/2/in_b_2
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    95
  ? b/in_b
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    96
  ? in_root
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    97
  $ hg status --cwd b/2 .
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    98
  ? in_b_2
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
    99
  $ hg status --cwd b/2 ..
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   100
  ? ../1/in_b_1
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   101
  ? in_b_2
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   102
  ? ../in_b
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   103
  $ cd ..
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   104
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   105
  $ hg init repo2
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   106
  $ cd repo2
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   107
  $ touch modified removed deleted ignored
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   108
  $ echo "^ignored$" > .hgignore
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11782
diff changeset
   109
  $ hg ci -A -m 'initial checkin'
11782
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   110
  adding .hgignore
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   111
  adding deleted
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   112
  adding modified
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   113
  adding removed
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   114
  $ touch modified added unknown ignored
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   115
  $ hg add added
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   116
  $ hg remove removed
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   117
  $ rm deleted
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   118
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   119
hg status:
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   120
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   121
  $ hg status
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   122
  A added
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   123
  R removed
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   124
  ! deleted
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   125
  ? unknown
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   126
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   127
hg status modified added removed deleted unknown never-existed ignored:
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   128
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   129
  $ hg status modified added removed deleted unknown never-existed ignored
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   130
  never-existed: No such file or directory
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   131
  A added
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   132
  R removed
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   133
  ! deleted
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   134
  ? unknown
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   135
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   136
  $ hg copy modified copied
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   137
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   138
hg status -C:
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   139
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   140
  $ hg status -C
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   141
  A added
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   142
  A copied
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   143
    modified
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   144
  R removed
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   145
  ! deleted
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   146
  ? unknown
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   147
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   148
hg status -A:
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   149
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   150
  $ hg status -A
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   151
  A added
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   152
  A copied
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   153
    modified
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   154
  R removed
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   155
  ! deleted
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   156
  ? unknown
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   157
  I ignored
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   158
  C .hgignore
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   159
  C modified
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   160
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   161
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   162
  $ echo "^ignoreddir$" > .hgignore
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   163
  $ mkdir ignoreddir
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   164
  $ touch ignoreddir/file
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   165
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   166
hg status ignoreddir/file:
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   167
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   168
  $ hg status ignoreddir/file
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   169
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   170
hg status -i ignoreddir/file:
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   171
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   172
  $ hg status -i ignoreddir/file
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   173
  I ignoreddir/file
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   174
  $ cd ..
6200
acc40572da5b 'hg status -q' output skips non-tracked files.
Zoran Bosnjak <zoran.bosnjak@via.si>
parents: 6033
diff changeset
   175
12328
b63f6422d2a7 tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   176
Check 'status -q' and some combinations
11782
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   177
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   178
  $ hg init repo3
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   179
  $ cd repo3
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   180
  $ touch modified removed deleted ignored
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   181
  $ echo "^ignored$" > .hgignore
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   182
  $ hg commit -A -m 'initial checkin'
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   183
  adding .hgignore
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   184
  adding deleted
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   185
  adding modified
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   186
  adding removed
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   187
  $ touch added unknown ignored
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   188
  $ hg add added
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   189
  $ echo "test" >> modified
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   190
  $ hg remove removed
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   191
  $ rm deleted
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   192
  $ hg copy modified copied
6200
acc40572da5b 'hg status -q' output skips non-tracked files.
Zoran Bosnjak <zoran.bosnjak@via.si>
parents: 6033
diff changeset
   193
12328
b63f6422d2a7 tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   194
Run status with 2 different flags.
b63f6422d2a7 tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   195
Check if result is the same or different.
b63f6422d2a7 tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   196
If result is not as expected, raise error
11782
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   197
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   198
  $ assert() {
12365
22f3353bcc36 tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents: 12328
diff changeset
   199
  >     hg status $1 > ../a
22f3353bcc36 tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents: 12328
diff changeset
   200
  >     hg status $2 > ../b
22f3353bcc36 tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents: 12328
diff changeset
   201
  >     if diff ../a ../b > /dev/null; then
22f3353bcc36 tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents: 12328
diff changeset
   202
  >         out=0
22f3353bcc36 tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents: 12328
diff changeset
   203
  >     else
11782
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   204
  >         out=1
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   205
  >     fi
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   206
  >     if [ $3 -eq 0 ]; then
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   207
  >         df="same"
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   208
  >     else
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   209
  >         df="different"
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   210
  >     fi
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   211
  >     if [ $out -ne $3 ]; then
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   212
  >         echo "Error on $1 and $2, should be $df."
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   213
  >     fi
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   214
  > }
6200
acc40572da5b 'hg status -q' output skips non-tracked files.
Zoran Bosnjak <zoran.bosnjak@via.si>
parents: 6033
diff changeset
   215
12328
b63f6422d2a7 tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   216
Assert flag1 flag2 [0-same | 1-different]
11782
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   217
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   218
  $ assert "-q" "-mard"      0
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   219
  $ assert "-A" "-marduicC"  0
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   220
  $ assert "-qA" "-mardcC"   0
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   221
  $ assert "-qAui" "-A"      0
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   222
  $ assert "-qAu" "-marducC" 0
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   223
  $ assert "-qAi" "-mardicC" 0
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   224
  $ assert "-qu" "-u"        0
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   225
  $ assert "-q" "-u"         1
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   226
  $ assert "-m" "-a"         1
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   227
  $ assert "-r" "-d"         1
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   228
  $ cd ..
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   229
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   230
  $ hg init repo4
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   231
  $ cd repo4
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   232
  $ touch modified removed deleted
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11782
diff changeset
   233
  $ hg ci -q -A -m 'initial checkin'
11782
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   234
  $ touch added unknown
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   235
  $ hg add added
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   236
  $ hg remove removed
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   237
  $ rm deleted
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   238
  $ echo x > modified
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   239
  $ hg copy modified copied
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   240
  $ hg ci -m 'test checkin' -d "1000001 0"
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   241
  $ rm *
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   242
  $ touch unrelated
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   243
  $ hg ci -q -A -m 'unrelated checkin' -d "1000002 0"
6200
acc40572da5b 'hg status -q' output skips non-tracked files.
Zoran Bosnjak <zoran.bosnjak@via.si>
parents: 6033
diff changeset
   244
11782
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   245
hg status --change 1:
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   246
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   247
  $ hg status --change 1
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   248
  M modified
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   249
  A added
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   250
  A copied
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   251
  R removed
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   252
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   253
hg status --change 1 unrelated:
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   254
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   255
  $ hg status --change 1 unrelated
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   256
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   257
hg status -C --change 1 added modified copied removed deleted:
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   258
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   259
  $ hg status -C --change 1 added modified copied removed deleted
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   260
  M modified
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   261
  A added
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   262
  A copied
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   263
    modified
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   264
  R removed
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   265
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   266
hg status -A --change 1:
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   267
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   268
  $ hg status -A --change 1
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   269
  M modified
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   270
  A added
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   271
  A copied
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   272
    modified
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   273
  R removed
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   274
  C deleted