tests/test-status.t
author Ryan McElroy <rmcelroy@fb.com>
Wed, 10 Feb 2016 09:06:08 -0800
changeset 28072 c3e9269d9602
parent 27749 215b47449e47
child 29000 2d3837a4bded
permissions -rw-r--r--
merge: minimize conflicts when common base is not shown (issue4447) Previously, two changes that were nearly, but not quite, identical would result in large merge conflict regions that looked very similar, and were thus very confusing to users, and lead people used to other source control systems to claim that "mercurial's merge algorithms suck". In the relatively common case of a new file being introduced in two branches with very slight modifications, the old behavior would show the entire file as a conflict, and it would be very difficult for a user to determine what was going on. In the past, mercurial attempted to solve this with a "very smart" algorithm that would find all common lines, but this has significant problems as described in 2ea6d906cf9b. Instead, we use a "very dumb" algorithm introduced in the previous patch that simply matches lines at the periphery of conflict regions. This minimizes most conflict regions well, though there may still be some degenerate edge cases, like small modification to the beginning and end of a large file.
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
19107
fcf08023c011 match: fix root calculation for combining regexps with simple paths
Mads Kiilerich <madski@unity3d.com>
parents: 17377
diff changeset
   103
fcf08023c011 match: fix root calculation for combining regexps with simple paths
Mads Kiilerich <madski@unity3d.com>
parents: 17377
diff changeset
   104
combining patterns with root and patterns without a root works
fcf08023c011 match: fix root calculation for combining regexps with simple paths
Mads Kiilerich <madski@unity3d.com>
parents: 17377
diff changeset
   105
fcf08023c011 match: fix root calculation for combining regexps with simple paths
Mads Kiilerich <madski@unity3d.com>
parents: 17377
diff changeset
   106
  $ hg st a/in_a re:.*b$
fcf08023c011 match: fix root calculation for combining regexps with simple paths
Mads Kiilerich <madski@unity3d.com>
parents: 17377
diff changeset
   107
  ? a/in_a
fcf08023c011 match: fix root calculation for combining regexps with simple paths
Mads Kiilerich <madski@unity3d.com>
parents: 17377
diff changeset
   108
  ? b/in_b
fcf08023c011 match: fix root calculation for combining regexps with simple paths
Mads Kiilerich <madski@unity3d.com>
parents: 17377
diff changeset
   109
11782
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   110
  $ cd ..
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   111
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   112
  $ hg init repo2
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   113
  $ cd repo2
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   114
  $ touch modified removed deleted ignored
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   115
  $ echo "^ignored$" > .hgignore
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11782
diff changeset
   116
  $ hg ci -A -m 'initial checkin'
11782
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   117
  adding .hgignore
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   118
  adding deleted
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   119
  adding modified
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   120
  adding removed
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   121
  $ touch modified added unknown ignored
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   122
  $ hg add added
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   123
  $ hg remove removed
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   124
  $ rm deleted
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   125
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   126
hg status:
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   127
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   128
  $ hg status
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   129
  A added
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   130
  R removed
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   131
  ! deleted
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   132
  ? unknown
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   133
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   134
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
   135
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   136
  $ hg status modified added removed deleted unknown never-existed ignored
15521
117f9190c1ba tests: hide 'No such file or directory' messages
Mads Kiilerich <mads@kiilerich.com>
parents: 14155
diff changeset
   137
  never-existed: * (glob)
11782
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   138
  A added
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   139
  R removed
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   140
  ! deleted
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   141
  ? unknown
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   142
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   143
  $ hg copy modified copied
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   144
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   145
hg status -C:
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   146
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   147
  $ hg status -C
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   148
  A added
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   149
  A copied
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   150
    modified
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   151
  R removed
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   152
  ! deleted
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   153
  ? unknown
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   154
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   155
hg status -A:
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   156
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   157
  $ hg status -A
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   158
  A added
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   159
  A copied
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   160
    modified
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   161
  R removed
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   162
  ! deleted
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   163
  ? unknown
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   164
  I ignored
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   165
  C .hgignore
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   166
  C modified
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   167
22429
7a7eed5176a4 commands: add hidden -T option for files/manifest/status/tags
Matt Mackall <mpm@selenic.com>
parents: 22424
diff changeset
   168
  $ hg status -A -Tjson
7a7eed5176a4 commands: add hidden -T option for files/manifest/status/tags
Matt Mackall <mpm@selenic.com>
parents: 22424
diff changeset
   169
  [
7a7eed5176a4 commands: add hidden -T option for files/manifest/status/tags
Matt Mackall <mpm@selenic.com>
parents: 22424
diff changeset
   170
   {
7a7eed5176a4 commands: add hidden -T option for files/manifest/status/tags
Matt Mackall <mpm@selenic.com>
parents: 22424
diff changeset
   171
    "path": "added",
7a7eed5176a4 commands: add hidden -T option for files/manifest/status/tags
Matt Mackall <mpm@selenic.com>
parents: 22424
diff changeset
   172
    "status": "A"
7a7eed5176a4 commands: add hidden -T option for files/manifest/status/tags
Matt Mackall <mpm@selenic.com>
parents: 22424
diff changeset
   173
   },
7a7eed5176a4 commands: add hidden -T option for files/manifest/status/tags
Matt Mackall <mpm@selenic.com>
parents: 22424
diff changeset
   174
   {
7a7eed5176a4 commands: add hidden -T option for files/manifest/status/tags
Matt Mackall <mpm@selenic.com>
parents: 22424
diff changeset
   175
    "copy": "modified",
7a7eed5176a4 commands: add hidden -T option for files/manifest/status/tags
Matt Mackall <mpm@selenic.com>
parents: 22424
diff changeset
   176
    "path": "copied",
7a7eed5176a4 commands: add hidden -T option for files/manifest/status/tags
Matt Mackall <mpm@selenic.com>
parents: 22424
diff changeset
   177
    "status": "A"
7a7eed5176a4 commands: add hidden -T option for files/manifest/status/tags
Matt Mackall <mpm@selenic.com>
parents: 22424
diff changeset
   178
   },
7a7eed5176a4 commands: add hidden -T option for files/manifest/status/tags
Matt Mackall <mpm@selenic.com>
parents: 22424
diff changeset
   179
   {
7a7eed5176a4 commands: add hidden -T option for files/manifest/status/tags
Matt Mackall <mpm@selenic.com>
parents: 22424
diff changeset
   180
    "path": "removed",
7a7eed5176a4 commands: add hidden -T option for files/manifest/status/tags
Matt Mackall <mpm@selenic.com>
parents: 22424
diff changeset
   181
    "status": "R"
7a7eed5176a4 commands: add hidden -T option for files/manifest/status/tags
Matt Mackall <mpm@selenic.com>
parents: 22424
diff changeset
   182
   },
7a7eed5176a4 commands: add hidden -T option for files/manifest/status/tags
Matt Mackall <mpm@selenic.com>
parents: 22424
diff changeset
   183
   {
7a7eed5176a4 commands: add hidden -T option for files/manifest/status/tags
Matt Mackall <mpm@selenic.com>
parents: 22424
diff changeset
   184
    "path": "deleted",
7a7eed5176a4 commands: add hidden -T option for files/manifest/status/tags
Matt Mackall <mpm@selenic.com>
parents: 22424
diff changeset
   185
    "status": "!"
7a7eed5176a4 commands: add hidden -T option for files/manifest/status/tags
Matt Mackall <mpm@selenic.com>
parents: 22424
diff changeset
   186
   },
7a7eed5176a4 commands: add hidden -T option for files/manifest/status/tags
Matt Mackall <mpm@selenic.com>
parents: 22424
diff changeset
   187
   {
7a7eed5176a4 commands: add hidden -T option for files/manifest/status/tags
Matt Mackall <mpm@selenic.com>
parents: 22424
diff changeset
   188
    "path": "unknown",
7a7eed5176a4 commands: add hidden -T option for files/manifest/status/tags
Matt Mackall <mpm@selenic.com>
parents: 22424
diff changeset
   189
    "status": "?"
7a7eed5176a4 commands: add hidden -T option for files/manifest/status/tags
Matt Mackall <mpm@selenic.com>
parents: 22424
diff changeset
   190
   },
7a7eed5176a4 commands: add hidden -T option for files/manifest/status/tags
Matt Mackall <mpm@selenic.com>
parents: 22424
diff changeset
   191
   {
7a7eed5176a4 commands: add hidden -T option for files/manifest/status/tags
Matt Mackall <mpm@selenic.com>
parents: 22424
diff changeset
   192
    "path": "ignored",
7a7eed5176a4 commands: add hidden -T option for files/manifest/status/tags
Matt Mackall <mpm@selenic.com>
parents: 22424
diff changeset
   193
    "status": "I"
7a7eed5176a4 commands: add hidden -T option for files/manifest/status/tags
Matt Mackall <mpm@selenic.com>
parents: 22424
diff changeset
   194
   },
7a7eed5176a4 commands: add hidden -T option for files/manifest/status/tags
Matt Mackall <mpm@selenic.com>
parents: 22424
diff changeset
   195
   {
7a7eed5176a4 commands: add hidden -T option for files/manifest/status/tags
Matt Mackall <mpm@selenic.com>
parents: 22424
diff changeset
   196
    "path": ".hgignore",
7a7eed5176a4 commands: add hidden -T option for files/manifest/status/tags
Matt Mackall <mpm@selenic.com>
parents: 22424
diff changeset
   197
    "status": "C"
7a7eed5176a4 commands: add hidden -T option for files/manifest/status/tags
Matt Mackall <mpm@selenic.com>
parents: 22424
diff changeset
   198
   },
7a7eed5176a4 commands: add hidden -T option for files/manifest/status/tags
Matt Mackall <mpm@selenic.com>
parents: 22424
diff changeset
   199
   {
7a7eed5176a4 commands: add hidden -T option for files/manifest/status/tags
Matt Mackall <mpm@selenic.com>
parents: 22424
diff changeset
   200
    "path": "modified",
7a7eed5176a4 commands: add hidden -T option for files/manifest/status/tags
Matt Mackall <mpm@selenic.com>
parents: 22424
diff changeset
   201
    "status": "C"
7a7eed5176a4 commands: add hidden -T option for files/manifest/status/tags
Matt Mackall <mpm@selenic.com>
parents: 22424
diff changeset
   202
   }
7a7eed5176a4 commands: add hidden -T option for files/manifest/status/tags
Matt Mackall <mpm@selenic.com>
parents: 22424
diff changeset
   203
  ]
11782
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   204
22430
968247e8f4ac formatter: add pickle format
Matt Mackall <mpm@selenic.com>
parents: 22429
diff changeset
   205
  $ hg status -A -Tpickle > pickle
968247e8f4ac formatter: add pickle format
Matt Mackall <mpm@selenic.com>
parents: 22429
diff changeset
   206
  >>> import pickle
968247e8f4ac formatter: add pickle format
Matt Mackall <mpm@selenic.com>
parents: 22429
diff changeset
   207
  >>> print sorted((x['status'], x['path']) for x in pickle.load(open("pickle")))
968247e8f4ac formatter: add pickle format
Matt Mackall <mpm@selenic.com>
parents: 22429
diff changeset
   208
  [('!', 'deleted'), ('?', 'pickle'), ('?', 'unknown'), ('A', 'added'), ('A', 'copied'), ('C', '.hgignore'), ('C', 'modified'), ('I', 'ignored'), ('R', 'removed')]
968247e8f4ac formatter: add pickle format
Matt Mackall <mpm@selenic.com>
parents: 22429
diff changeset
   209
  $ rm pickle
968247e8f4ac formatter: add pickle format
Matt Mackall <mpm@selenic.com>
parents: 22429
diff changeset
   210
11782
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   211
  $ echo "^ignoreddir$" > .hgignore
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   212
  $ mkdir ignoreddir
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   213
  $ touch ignoreddir/file
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   214
25515
e8075329c5fb tests: test basic template support for status
Matt Mackall <mpm@selenic.com>
parents: 24663
diff changeset
   215
Test templater support:
e8075329c5fb tests: test basic template support for status
Matt Mackall <mpm@selenic.com>
parents: 24663
diff changeset
   216
e8075329c5fb tests: test basic template support for status
Matt Mackall <mpm@selenic.com>
parents: 24663
diff changeset
   217
  $ hg status -AT "[{status}]\t{if(copy, '{copy} -> ')}{path}\n"
e8075329c5fb tests: test basic template support for status
Matt Mackall <mpm@selenic.com>
parents: 24663
diff changeset
   218
  [M]	.hgignore
e8075329c5fb tests: test basic template support for status
Matt Mackall <mpm@selenic.com>
parents: 24663
diff changeset
   219
  [A]	added
e8075329c5fb tests: test basic template support for status
Matt Mackall <mpm@selenic.com>
parents: 24663
diff changeset
   220
  [A]	modified -> copied
e8075329c5fb tests: test basic template support for status
Matt Mackall <mpm@selenic.com>
parents: 24663
diff changeset
   221
  [R]	removed
e8075329c5fb tests: test basic template support for status
Matt Mackall <mpm@selenic.com>
parents: 24663
diff changeset
   222
  [!]	deleted
e8075329c5fb tests: test basic template support for status
Matt Mackall <mpm@selenic.com>
parents: 24663
diff changeset
   223
  [?]	ignored
e8075329c5fb tests: test basic template support for status
Matt Mackall <mpm@selenic.com>
parents: 24663
diff changeset
   224
  [?]	unknown
e8075329c5fb tests: test basic template support for status
Matt Mackall <mpm@selenic.com>
parents: 24663
diff changeset
   225
  [I]	ignoreddir/file
e8075329c5fb tests: test basic template support for status
Matt Mackall <mpm@selenic.com>
parents: 24663
diff changeset
   226
  [C]	modified
e8075329c5fb tests: test basic template support for status
Matt Mackall <mpm@selenic.com>
parents: 24663
diff changeset
   227
  $ hg status -AT default
e8075329c5fb tests: test basic template support for status
Matt Mackall <mpm@selenic.com>
parents: 24663
diff changeset
   228
  M .hgignore
e8075329c5fb tests: test basic template support for status
Matt Mackall <mpm@selenic.com>
parents: 24663
diff changeset
   229
  A added
e8075329c5fb tests: test basic template support for status
Matt Mackall <mpm@selenic.com>
parents: 24663
diff changeset
   230
  A copied
e8075329c5fb tests: test basic template support for status
Matt Mackall <mpm@selenic.com>
parents: 24663
diff changeset
   231
    modified
e8075329c5fb tests: test basic template support for status
Matt Mackall <mpm@selenic.com>
parents: 24663
diff changeset
   232
  R removed
e8075329c5fb tests: test basic template support for status
Matt Mackall <mpm@selenic.com>
parents: 24663
diff changeset
   233
  ! deleted
e8075329c5fb tests: test basic template support for status
Matt Mackall <mpm@selenic.com>
parents: 24663
diff changeset
   234
  ? ignored
e8075329c5fb tests: test basic template support for status
Matt Mackall <mpm@selenic.com>
parents: 24663
diff changeset
   235
  ? unknown
e8075329c5fb tests: test basic template support for status
Matt Mackall <mpm@selenic.com>
parents: 24663
diff changeset
   236
  I ignoreddir/file
e8075329c5fb tests: test basic template support for status
Matt Mackall <mpm@selenic.com>
parents: 24663
diff changeset
   237
  C modified
e8075329c5fb tests: test basic template support for status
Matt Mackall <mpm@selenic.com>
parents: 24663
diff changeset
   238
  $ hg status -T compact
e8075329c5fb tests: test basic template support for status
Matt Mackall <mpm@selenic.com>
parents: 24663
diff changeset
   239
  abort: "status" not in template map
e8075329c5fb tests: test basic template support for status
Matt Mackall <mpm@selenic.com>
parents: 24663
diff changeset
   240
  [255]
e8075329c5fb tests: test basic template support for status
Matt Mackall <mpm@selenic.com>
parents: 24663
diff changeset
   241
11782
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   242
hg status ignoreddir/file:
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   243
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   244
  $ hg status ignoreddir/file
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   245
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   246
hg status -i ignoreddir/file:
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   247
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   248
  $ hg status -i ignoreddir/file
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   249
  I ignoreddir/file
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   250
  $ cd ..
6200
acc40572da5b 'hg status -q' output skips non-tracked files.
Zoran Bosnjak <zoran.bosnjak@via.si>
parents: 6033
diff changeset
   251
12328
b63f6422d2a7 tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   252
Check 'status -q' and some combinations
11782
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   253
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   254
  $ hg init repo3
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   255
  $ cd repo3
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   256
  $ touch modified removed deleted ignored
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   257
  $ echo "^ignored$" > .hgignore
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   258
  $ hg commit -A -m 'initial checkin'
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   259
  adding .hgignore
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   260
  adding deleted
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   261
  adding modified
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   262
  adding removed
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   263
  $ touch added unknown ignored
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   264
  $ hg add added
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   265
  $ echo "test" >> modified
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   266
  $ hg remove removed
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   267
  $ rm deleted
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   268
  $ hg copy modified copied
6200
acc40572da5b 'hg status -q' output skips non-tracked files.
Zoran Bosnjak <zoran.bosnjak@via.si>
parents: 6033
diff changeset
   269
24419
0e41f110e69e revset: add wdir() function to specify workingctx revision by command
Yuya Nishihara <yuya@tcha.org>
parents: 23402
diff changeset
   270
Specify working directory revision explicitly, that should be the same as
0e41f110e69e revset: add wdir() function to specify workingctx revision by command
Yuya Nishihara <yuya@tcha.org>
parents: 23402
diff changeset
   271
"hg status"
0e41f110e69e revset: add wdir() function to specify workingctx revision by command
Yuya Nishihara <yuya@tcha.org>
parents: 23402
diff changeset
   272
0e41f110e69e revset: add wdir() function to specify workingctx revision by command
Yuya Nishihara <yuya@tcha.org>
parents: 23402
diff changeset
   273
  $ hg status --change "wdir()"
0e41f110e69e revset: add wdir() function to specify workingctx revision by command
Yuya Nishihara <yuya@tcha.org>
parents: 23402
diff changeset
   274
  M modified
0e41f110e69e revset: add wdir() function to specify workingctx revision by command
Yuya Nishihara <yuya@tcha.org>
parents: 23402
diff changeset
   275
  A added
0e41f110e69e revset: add wdir() function to specify workingctx revision by command
Yuya Nishihara <yuya@tcha.org>
parents: 23402
diff changeset
   276
  A copied
0e41f110e69e revset: add wdir() function to specify workingctx revision by command
Yuya Nishihara <yuya@tcha.org>
parents: 23402
diff changeset
   277
  R removed
0e41f110e69e revset: add wdir() function to specify workingctx revision by command
Yuya Nishihara <yuya@tcha.org>
parents: 23402
diff changeset
   278
  ! deleted
0e41f110e69e revset: add wdir() function to specify workingctx revision by command
Yuya Nishihara <yuya@tcha.org>
parents: 23402
diff changeset
   279
  ? unknown
0e41f110e69e revset: add wdir() function to specify workingctx revision by command
Yuya Nishihara <yuya@tcha.org>
parents: 23402
diff changeset
   280
12328
b63f6422d2a7 tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   281
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
   282
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
   283
If result is not as expected, raise error
11782
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   284
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   285
  $ assert() {
12365
22f3353bcc36 tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents: 12328
diff changeset
   286
  >     hg status $1 > ../a
22f3353bcc36 tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents: 12328
diff changeset
   287
  >     hg status $2 > ../b
22f3353bcc36 tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents: 12328
diff changeset
   288
  >     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
   289
  >         out=0
22f3353bcc36 tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents: 12328
diff changeset
   290
  >     else
11782
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   291
  >         out=1
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   292
  >     fi
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   293
  >     if [ $3 -eq 0 ]; then
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   294
  >         df="same"
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   295
  >     else
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   296
  >         df="different"
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   297
  >     fi
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   298
  >     if [ $out -ne $3 ]; then
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   299
  >         echo "Error on $1 and $2, should be $df."
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   300
  >     fi
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   301
  > }
6200
acc40572da5b 'hg status -q' output skips non-tracked files.
Zoran Bosnjak <zoran.bosnjak@via.si>
parents: 6033
diff changeset
   302
12328
b63f6422d2a7 tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   303
Assert flag1 flag2 [0-same | 1-different]
11782
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   304
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   305
  $ assert "-q" "-mard"      0
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   306
  $ assert "-A" "-marduicC"  0
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   307
  $ assert "-qA" "-mardcC"   0
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   308
  $ assert "-qAui" "-A"      0
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   309
  $ assert "-qAu" "-marducC" 0
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   310
  $ assert "-qAi" "-mardicC" 0
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   311
  $ assert "-qu" "-u"        0
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   312
  $ assert "-q" "-u"         1
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   313
  $ assert "-m" "-a"         1
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   314
  $ assert "-r" "-d"         1
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   315
  $ cd ..
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   316
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   317
  $ hg init repo4
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   318
  $ cd repo4
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   319
  $ touch modified removed deleted
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11782
diff changeset
   320
  $ hg ci -q -A -m 'initial checkin'
11782
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   321
  $ touch added unknown
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   322
  $ hg add added
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   323
  $ hg remove removed
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   324
  $ rm deleted
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   325
  $ echo x > modified
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   326
  $ hg copy modified copied
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   327
  $ hg ci -m 'test checkin' -d "1000001 0"
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   328
  $ rm *
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   329
  $ touch unrelated
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   330
  $ 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
   331
11782
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   332
hg status --change 1:
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   333
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   334
  $ hg status --change 1
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   335
  M modified
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   336
  A added
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   337
  A copied
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   338
  R removed
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   339
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   340
hg status --change 1 unrelated:
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   341
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   342
  $ hg status --change 1 unrelated
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   343
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   344
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
   345
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   346
  $ 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
   347
  M modified
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   348
  A added
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   349
  A copied
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   350
    modified
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   351
  R removed
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   352
15578
db0e277bdd37 status: support revsets with --change
Patrick Mezard <pmezard@gmail.com>
parents: 15521
diff changeset
   353
hg status -A --change 1 and revset:
11782
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   354
15578
db0e277bdd37 status: support revsets with --change
Patrick Mezard <pmezard@gmail.com>
parents: 15521
diff changeset
   355
  $ hg status -A --change '1|1'
11782
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   356
  M modified
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   357
  A added
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   358
  A copied
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   359
    modified
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   360
  R removed
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
   361
  C deleted
15848
012b285cf643 filectx: fix cmp() of file starting with '\1\n'
Yuya Nishihara <yuya@tcha.org>
parents: 14155
diff changeset
   362
012b285cf643 filectx: fix cmp() of file starting with '\1\n'
Yuya Nishihara <yuya@tcha.org>
parents: 14155
diff changeset
   363
  $ cd ..
012b285cf643 filectx: fix cmp() of file starting with '\1\n'
Yuya Nishihara <yuya@tcha.org>
parents: 14155
diff changeset
   364
27668
369c8f9453c2 status: revert + flag-change == modified
Martin von Zweigbergk <martinvonz@google.com>
parents: 25515
diff changeset
   365
hg status with --rev and reverted changes:
369c8f9453c2 status: revert + flag-change == modified
Martin von Zweigbergk <martinvonz@google.com>
parents: 25515
diff changeset
   366
369c8f9453c2 status: revert + flag-change == modified
Martin von Zweigbergk <martinvonz@google.com>
parents: 25515
diff changeset
   367
  $ hg init reverted-changes-repo
369c8f9453c2 status: revert + flag-change == modified
Martin von Zweigbergk <martinvonz@google.com>
parents: 25515
diff changeset
   368
  $ cd reverted-changes-repo
369c8f9453c2 status: revert + flag-change == modified
Martin von Zweigbergk <martinvonz@google.com>
parents: 25515
diff changeset
   369
  $ echo a > file
369c8f9453c2 status: revert + flag-change == modified
Martin von Zweigbergk <martinvonz@google.com>
parents: 25515
diff changeset
   370
  $ hg add file
369c8f9453c2 status: revert + flag-change == modified
Martin von Zweigbergk <martinvonz@google.com>
parents: 25515
diff changeset
   371
  $ hg ci -m a
369c8f9453c2 status: revert + flag-change == modified
Martin von Zweigbergk <martinvonz@google.com>
parents: 25515
diff changeset
   372
  $ echo b > file
369c8f9453c2 status: revert + flag-change == modified
Martin von Zweigbergk <martinvonz@google.com>
parents: 25515
diff changeset
   373
  $ hg ci -m b
369c8f9453c2 status: revert + flag-change == modified
Martin von Zweigbergk <martinvonz@google.com>
parents: 25515
diff changeset
   374
369c8f9453c2 status: revert + flag-change == modified
Martin von Zweigbergk <martinvonz@google.com>
parents: 25515
diff changeset
   375
reverted file should appear clean
369c8f9453c2 status: revert + flag-change == modified
Martin von Zweigbergk <martinvonz@google.com>
parents: 25515
diff changeset
   376
369c8f9453c2 status: revert + flag-change == modified
Martin von Zweigbergk <martinvonz@google.com>
parents: 25515
diff changeset
   377
  $ hg revert -r 0 .
369c8f9453c2 status: revert + flag-change == modified
Martin von Zweigbergk <martinvonz@google.com>
parents: 25515
diff changeset
   378
  reverting file
369c8f9453c2 status: revert + flag-change == modified
Martin von Zweigbergk <martinvonz@google.com>
parents: 25515
diff changeset
   379
  $ hg status -A --rev 0
369c8f9453c2 status: revert + flag-change == modified
Martin von Zweigbergk <martinvonz@google.com>
parents: 25515
diff changeset
   380
  C file
369c8f9453c2 status: revert + flag-change == modified
Martin von Zweigbergk <martinvonz@google.com>
parents: 25515
diff changeset
   381
369c8f9453c2 status: revert + flag-change == modified
Martin von Zweigbergk <martinvonz@google.com>
parents: 25515
diff changeset
   382
#if execbit
369c8f9453c2 status: revert + flag-change == modified
Martin von Zweigbergk <martinvonz@google.com>
parents: 25515
diff changeset
   383
reverted file with changed flag should appear modified
369c8f9453c2 status: revert + flag-change == modified
Martin von Zweigbergk <martinvonz@google.com>
parents: 25515
diff changeset
   384
369c8f9453c2 status: revert + flag-change == modified
Martin von Zweigbergk <martinvonz@google.com>
parents: 25515
diff changeset
   385
  $ chmod +x file
369c8f9453c2 status: revert + flag-change == modified
Martin von Zweigbergk <martinvonz@google.com>
parents: 25515
diff changeset
   386
  $ hg status -A --rev 0
369c8f9453c2 status: revert + flag-change == modified
Martin von Zweigbergk <martinvonz@google.com>
parents: 25515
diff changeset
   387
  M file
369c8f9453c2 status: revert + flag-change == modified
Martin von Zweigbergk <martinvonz@google.com>
parents: 25515
diff changeset
   388
27743
5dcadc6c5aed test-status: stabilize for no-execbit platforms
Matt Harbison <matt_harbison@yahoo.com>
parents: 27720
diff changeset
   389
  $ hg revert -r 0 .
5dcadc6c5aed test-status: stabilize for no-execbit platforms
Matt Harbison <matt_harbison@yahoo.com>
parents: 27720
diff changeset
   390
  reverting file
27749
215b47449e47 context: check for differing flags a little earlier
Martin von Zweigbergk <martinvonz@google.com>
parents: 27747
diff changeset
   391
215b47449e47 context: check for differing flags a little earlier
Martin von Zweigbergk <martinvonz@google.com>
parents: 27747
diff changeset
   392
reverted and committed file with changed flag should appear modified
215b47449e47 context: check for differing flags a little earlier
Martin von Zweigbergk <martinvonz@google.com>
parents: 27747
diff changeset
   393
215b47449e47 context: check for differing flags a little earlier
Martin von Zweigbergk <martinvonz@google.com>
parents: 27747
diff changeset
   394
  $ hg co -C .
215b47449e47 context: check for differing flags a little earlier
Martin von Zweigbergk <martinvonz@google.com>
parents: 27747
diff changeset
   395
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
215b47449e47 context: check for differing flags a little earlier
Martin von Zweigbergk <martinvonz@google.com>
parents: 27747
diff changeset
   396
  $ chmod +x file
215b47449e47 context: check for differing flags a little earlier
Martin von Zweigbergk <martinvonz@google.com>
parents: 27747
diff changeset
   397
  $ hg ci -m 'change flag'
215b47449e47 context: check for differing flags a little earlier
Martin von Zweigbergk <martinvonz@google.com>
parents: 27747
diff changeset
   398
  $ hg status -A --rev 1 --rev 2
215b47449e47 context: check for differing flags a little earlier
Martin von Zweigbergk <martinvonz@google.com>
parents: 27747
diff changeset
   399
  M file
215b47449e47 context: check for differing flags a little earlier
Martin von Zweigbergk <martinvonz@google.com>
parents: 27747
diff changeset
   400
  $ hg diff -r 1 -r 2
215b47449e47 context: check for differing flags a little earlier
Martin von Zweigbergk <martinvonz@google.com>
parents: 27747
diff changeset
   401
27668
369c8f9453c2 status: revert + flag-change == modified
Martin von Zweigbergk <martinvonz@google.com>
parents: 25515
diff changeset
   402
#endif
369c8f9453c2 status: revert + flag-change == modified
Martin von Zweigbergk <martinvonz@google.com>
parents: 25515
diff changeset
   403
15848
012b285cf643 filectx: fix cmp() of file starting with '\1\n'
Yuya Nishihara <yuya@tcha.org>
parents: 14155
diff changeset
   404
hg status of binary file starting with '\1\n', a separator for metadata:
012b285cf643 filectx: fix cmp() of file starting with '\1\n'
Yuya Nishihara <yuya@tcha.org>
parents: 14155
diff changeset
   405
012b285cf643 filectx: fix cmp() of file starting with '\1\n'
Yuya Nishihara <yuya@tcha.org>
parents: 14155
diff changeset
   406
  $ hg init repo5
012b285cf643 filectx: fix cmp() of file starting with '\1\n'
Yuya Nishihara <yuya@tcha.org>
parents: 14155
diff changeset
   407
  $ cd repo5
16098
c6c9b83a1e8a tests: tighten checks for octal escapes in shell printf.
Jim Hague <jim.hague@acm.org>
parents: 15869
diff changeset
   408
  >>> open("010a", "wb").write("\1\nfoo")
15848
012b285cf643 filectx: fix cmp() of file starting with '\1\n'
Yuya Nishihara <yuya@tcha.org>
parents: 14155
diff changeset
   409
  $ hg ci -q -A -m 'initial checkin'
012b285cf643 filectx: fix cmp() of file starting with '\1\n'
Yuya Nishihara <yuya@tcha.org>
parents: 14155
diff changeset
   410
  $ hg status -A
012b285cf643 filectx: fix cmp() of file starting with '\1\n'
Yuya Nishihara <yuya@tcha.org>
parents: 14155
diff changeset
   411
  C 010a
012b285cf643 filectx: fix cmp() of file starting with '\1\n'
Yuya Nishihara <yuya@tcha.org>
parents: 14155
diff changeset
   412
16098
c6c9b83a1e8a tests: tighten checks for octal escapes in shell printf.
Jim Hague <jim.hague@acm.org>
parents: 15869
diff changeset
   413
  >>> open("010a", "wb").write("\1\nbar")
15848
012b285cf643 filectx: fix cmp() of file starting with '\1\n'
Yuya Nishihara <yuya@tcha.org>
parents: 14155
diff changeset
   414
  $ hg status -A
012b285cf643 filectx: fix cmp() of file starting with '\1\n'
Yuya Nishihara <yuya@tcha.org>
parents: 14155
diff changeset
   415
  M 010a
012b285cf643 filectx: fix cmp() of file starting with '\1\n'
Yuya Nishihara <yuya@tcha.org>
parents: 14155
diff changeset
   416
  $ hg ci -q -m 'modify 010a'
012b285cf643 filectx: fix cmp() of file starting with '\1\n'
Yuya Nishihara <yuya@tcha.org>
parents: 14155
diff changeset
   417
  $ hg status -A --rev 0:1
012b285cf643 filectx: fix cmp() of file starting with '\1\n'
Yuya Nishihara <yuya@tcha.org>
parents: 14155
diff changeset
   418
  M 010a
012b285cf643 filectx: fix cmp() of file starting with '\1\n'
Yuya Nishihara <yuya@tcha.org>
parents: 14155
diff changeset
   419
012b285cf643 filectx: fix cmp() of file starting with '\1\n'
Yuya Nishihara <yuya@tcha.org>
parents: 14155
diff changeset
   420
  $ touch empty
012b285cf643 filectx: fix cmp() of file starting with '\1\n'
Yuya Nishihara <yuya@tcha.org>
parents: 14155
diff changeset
   421
  $ hg ci -q -A -m 'add another file'
012b285cf643 filectx: fix cmp() of file starting with '\1\n'
Yuya Nishihara <yuya@tcha.org>
parents: 14155
diff changeset
   422
  $ hg status -A --rev 1:2 010a
012b285cf643 filectx: fix cmp() of file starting with '\1\n'
Yuya Nishihara <yuya@tcha.org>
parents: 14155
diff changeset
   423
  C 010a
16144
4546a8513dcd localrepository: use 'changectx.dirs()' in 'status()' for directory patterns
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16098
diff changeset
   424
4546a8513dcd localrepository: use 'changectx.dirs()' in 'status()' for directory patterns
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16098
diff changeset
   425
  $ cd ..
4546a8513dcd localrepository: use 'changectx.dirs()' in 'status()' for directory patterns
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16098
diff changeset
   426
4546a8513dcd localrepository: use 'changectx.dirs()' in 'status()' for directory patterns
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16098
diff changeset
   427
test "hg status" with "directory pattern" which matches against files
4546a8513dcd localrepository: use 'changectx.dirs()' in 'status()' for directory patterns
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16098
diff changeset
   428
only known on target revision.
4546a8513dcd localrepository: use 'changectx.dirs()' in 'status()' for directory patterns
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16098
diff changeset
   429
4546a8513dcd localrepository: use 'changectx.dirs()' in 'status()' for directory patterns
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16098
diff changeset
   430
  $ hg init repo6
4546a8513dcd localrepository: use 'changectx.dirs()' in 'status()' for directory patterns
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16098
diff changeset
   431
  $ cd repo6
4546a8513dcd localrepository: use 'changectx.dirs()' in 'status()' for directory patterns
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16098
diff changeset
   432
4546a8513dcd localrepository: use 'changectx.dirs()' in 'status()' for directory patterns
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16098
diff changeset
   433
  $ echo a > a.txt
4546a8513dcd localrepository: use 'changectx.dirs()' in 'status()' for directory patterns
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16098
diff changeset
   434
  $ hg add a.txt
4546a8513dcd localrepository: use 'changectx.dirs()' in 'status()' for directory patterns
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16098
diff changeset
   435
  $ hg commit -m '#0'
4546a8513dcd localrepository: use 'changectx.dirs()' in 'status()' for directory patterns
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16098
diff changeset
   436
  $ mkdir -p 1/2/3/4/5
4546a8513dcd localrepository: use 'changectx.dirs()' in 'status()' for directory patterns
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16098
diff changeset
   437
  $ echo b > 1/2/3/4/5/b.txt
4546a8513dcd localrepository: use 'changectx.dirs()' in 'status()' for directory patterns
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16098
diff changeset
   438
  $ hg add 1/2/3/4/5/b.txt
4546a8513dcd localrepository: use 'changectx.dirs()' in 'status()' for directory patterns
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16098
diff changeset
   439
  $ hg commit -m '#1'
4546a8513dcd localrepository: use 'changectx.dirs()' in 'status()' for directory patterns
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16098
diff changeset
   440
4546a8513dcd localrepository: use 'changectx.dirs()' in 'status()' for directory patterns
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16098
diff changeset
   441
  $ hg update -C 0 > /dev/null
4546a8513dcd localrepository: use 'changectx.dirs()' in 'status()' for directory patterns
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16098
diff changeset
   442
  $ hg status -A
4546a8513dcd localrepository: use 'changectx.dirs()' in 'status()' for directory patterns
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16098
diff changeset
   443
  C a.txt
4546a8513dcd localrepository: use 'changectx.dirs()' in 'status()' for directory patterns
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16098
diff changeset
   444
4546a8513dcd localrepository: use 'changectx.dirs()' in 'status()' for directory patterns
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16098
diff changeset
   445
the directory matching against specified pattern should be removed,
4546a8513dcd localrepository: use 'changectx.dirs()' in 'status()' for directory patterns
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16098
diff changeset
   446
because directory existence prevents 'dirstate.walk()' from showing
4546a8513dcd localrepository: use 'changectx.dirs()' in 'status()' for directory patterns
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16098
diff changeset
   447
warning message about such pattern.
4546a8513dcd localrepository: use 'changectx.dirs()' in 'status()' for directory patterns
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16098
diff changeset
   448
4546a8513dcd localrepository: use 'changectx.dirs()' in 'status()' for directory patterns
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16098
diff changeset
   449
  $ test ! -d 1
4546a8513dcd localrepository: use 'changectx.dirs()' in 'status()' for directory patterns
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16098
diff changeset
   450
  $ hg status -A --rev 1 1/2/3/4/5/b.txt
4546a8513dcd localrepository: use 'changectx.dirs()' in 'status()' for directory patterns
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16098
diff changeset
   451
  R 1/2/3/4/5/b.txt
4546a8513dcd localrepository: use 'changectx.dirs()' in 'status()' for directory patterns
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16098
diff changeset
   452
  $ hg status -A --rev 1 1/2/3/4/5
4546a8513dcd localrepository: use 'changectx.dirs()' in 'status()' for directory patterns
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16098
diff changeset
   453
  R 1/2/3/4/5/b.txt
4546a8513dcd localrepository: use 'changectx.dirs()' in 'status()' for directory patterns
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16098
diff changeset
   454
  $ hg status -A --rev 1 1/2/3
4546a8513dcd localrepository: use 'changectx.dirs()' in 'status()' for directory patterns
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16098
diff changeset
   455
  R 1/2/3/4/5/b.txt
4546a8513dcd localrepository: use 'changectx.dirs()' in 'status()' for directory patterns
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16098
diff changeset
   456
  $ hg status -A --rev 1 1
4546a8513dcd localrepository: use 'changectx.dirs()' in 'status()' for directory patterns
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16098
diff changeset
   457
  R 1/2/3/4/5/b.txt
4546a8513dcd localrepository: use 'changectx.dirs()' in 'status()' for directory patterns
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16098
diff changeset
   458
22424
1f72226064b8 formatter: make debug style match Python syntax
Matt Mackall <mpm@selenic.com>
parents: 21972
diff changeset
   459
  $ hg status --config ui.formatdebug=True --rev 1 1
1f72226064b8 formatter: make debug style match Python syntax
Matt Mackall <mpm@selenic.com>
parents: 21972
diff changeset
   460
  status = [
1f72226064b8 formatter: make debug style match Python syntax
Matt Mackall <mpm@selenic.com>
parents: 21972
diff changeset
   461
      {*'path': '1/2/3/4/5/b.txt'*}, (glob)
1f72226064b8 formatter: make debug style match Python syntax
Matt Mackall <mpm@selenic.com>
parents: 21972
diff changeset
   462
  ]
1f72226064b8 formatter: make debug style match Python syntax
Matt Mackall <mpm@selenic.com>
parents: 21972
diff changeset
   463
17377
a10f7eeb2588 test-status.t: test ui.slash on Windows
Patrick Mezard <patrick@mezard.eu>
parents: 16144
diff changeset
   464
#if windows
a10f7eeb2588 test-status.t: test ui.slash on Windows
Patrick Mezard <patrick@mezard.eu>
parents: 16144
diff changeset
   465
  $ hg --config ui.slash=false status -A --rev 1 1
a10f7eeb2588 test-status.t: test ui.slash on Windows
Patrick Mezard <patrick@mezard.eu>
parents: 16144
diff changeset
   466
  R 1\2\3\4\5\b.txt
a10f7eeb2588 test-status.t: test ui.slash on Windows
Patrick Mezard <patrick@mezard.eu>
parents: 16144
diff changeset
   467
#endif
a10f7eeb2588 test-status.t: test ui.slash on Windows
Patrick Mezard <patrick@mezard.eu>
parents: 16144
diff changeset
   468
16144
4546a8513dcd localrepository: use 'changectx.dirs()' in 'status()' for directory patterns
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16098
diff changeset
   469
  $ cd ..
23402
2963d5c9d90b rename: properly report removed and added file as modified (issue4458)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23037
diff changeset
   470
2963d5c9d90b rename: properly report removed and added file as modified (issue4458)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23037
diff changeset
   471
Status after move overwriting a file (issue4458)
2963d5c9d90b rename: properly report removed and added file as modified (issue4458)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23037
diff changeset
   472
=================================================
2963d5c9d90b rename: properly report removed and added file as modified (issue4458)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23037
diff changeset
   473
2963d5c9d90b rename: properly report removed and added file as modified (issue4458)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23037
diff changeset
   474
2963d5c9d90b rename: properly report removed and added file as modified (issue4458)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23037
diff changeset
   475
  $ hg init issue4458
2963d5c9d90b rename: properly report removed and added file as modified (issue4458)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23037
diff changeset
   476
  $ cd issue4458
2963d5c9d90b rename: properly report removed and added file as modified (issue4458)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23037
diff changeset
   477
  $ echo a > a
2963d5c9d90b rename: properly report removed and added file as modified (issue4458)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23037
diff changeset
   478
  $ echo b > b
2963d5c9d90b rename: properly report removed and added file as modified (issue4458)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23037
diff changeset
   479
  $ hg commit -Am base
2963d5c9d90b rename: properly report removed and added file as modified (issue4458)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23037
diff changeset
   480
  adding a
2963d5c9d90b rename: properly report removed and added file as modified (issue4458)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23037
diff changeset
   481
  adding b
2963d5c9d90b rename: properly report removed and added file as modified (issue4458)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23037
diff changeset
   482
2963d5c9d90b rename: properly report removed and added file as modified (issue4458)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23037
diff changeset
   483
2963d5c9d90b rename: properly report removed and added file as modified (issue4458)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23037
diff changeset
   484
with --force
2963d5c9d90b rename: properly report removed and added file as modified (issue4458)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23037
diff changeset
   485
2963d5c9d90b rename: properly report removed and added file as modified (issue4458)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23037
diff changeset
   486
  $ hg mv b --force a
2963d5c9d90b rename: properly report removed and added file as modified (issue4458)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23037
diff changeset
   487
  $ hg st --copies
2963d5c9d90b rename: properly report removed and added file as modified (issue4458)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23037
diff changeset
   488
  M a
2963d5c9d90b rename: properly report removed and added file as modified (issue4458)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23037
diff changeset
   489
    b
2963d5c9d90b rename: properly report removed and added file as modified (issue4458)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23037
diff changeset
   490
  R b
2963d5c9d90b rename: properly report removed and added file as modified (issue4458)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23037
diff changeset
   491
  $ hg revert --all
2963d5c9d90b rename: properly report removed and added file as modified (issue4458)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23037
diff changeset
   492
  reverting a
2963d5c9d90b rename: properly report removed and added file as modified (issue4458)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23037
diff changeset
   493
  undeleting b
2963d5c9d90b rename: properly report removed and added file as modified (issue4458)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23037
diff changeset
   494
  $ rm *.orig
2963d5c9d90b rename: properly report removed and added file as modified (issue4458)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23037
diff changeset
   495
2963d5c9d90b rename: properly report removed and added file as modified (issue4458)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23037
diff changeset
   496
without force
2963d5c9d90b rename: properly report removed and added file as modified (issue4458)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23037
diff changeset
   497
2963d5c9d90b rename: properly report removed and added file as modified (issue4458)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23037
diff changeset
   498
  $ hg rm a
2963d5c9d90b rename: properly report removed and added file as modified (issue4458)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23037
diff changeset
   499
  $ hg st --copies
2963d5c9d90b rename: properly report removed and added file as modified (issue4458)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23037
diff changeset
   500
  R a
2963d5c9d90b rename: properly report removed and added file as modified (issue4458)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23037
diff changeset
   501
  $ hg mv b a
2963d5c9d90b rename: properly report removed and added file as modified (issue4458)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23037
diff changeset
   502
  $ hg st --copies
2963d5c9d90b rename: properly report removed and added file as modified (issue4458)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23037
diff changeset
   503
  M a
2963d5c9d90b rename: properly report removed and added file as modified (issue4458)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23037
diff changeset
   504
    b
2963d5c9d90b rename: properly report removed and added file as modified (issue4458)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23037
diff changeset
   505
  R b
2963d5c9d90b rename: properly report removed and added file as modified (issue4458)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23037
diff changeset
   506
24663
7d01371e6358 commands: add ui.statuscopies config knob
Mathias De Maré <mathias.demare@gmail.com>
parents: 24419
diff changeset
   507
using ui.statuscopies setting
7d01371e6358 commands: add ui.statuscopies config knob
Mathias De Maré <mathias.demare@gmail.com>
parents: 24419
diff changeset
   508
  $ hg st --config ui.statuscopies=true
7d01371e6358 commands: add ui.statuscopies config knob
Mathias De Maré <mathias.demare@gmail.com>
parents: 24419
diff changeset
   509
  M a
7d01371e6358 commands: add ui.statuscopies config knob
Mathias De Maré <mathias.demare@gmail.com>
parents: 24419
diff changeset
   510
    b
7d01371e6358 commands: add ui.statuscopies config knob
Mathias De Maré <mathias.demare@gmail.com>
parents: 24419
diff changeset
   511
  R b
7d01371e6358 commands: add ui.statuscopies config knob
Mathias De Maré <mathias.demare@gmail.com>
parents: 24419
diff changeset
   512
  $ hg st --config ui.statuscopies=false
7d01371e6358 commands: add ui.statuscopies config knob
Mathias De Maré <mathias.demare@gmail.com>
parents: 24419
diff changeset
   513
  M a
7d01371e6358 commands: add ui.statuscopies config knob
Mathias De Maré <mathias.demare@gmail.com>
parents: 24419
diff changeset
   514
  R b
7d01371e6358 commands: add ui.statuscopies config knob
Mathias De Maré <mathias.demare@gmail.com>
parents: 24419
diff changeset
   515
23402
2963d5c9d90b rename: properly report removed and added file as modified (issue4458)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23037
diff changeset
   516
Other "bug" highlight, the revision status does not report the copy information.
2963d5c9d90b rename: properly report removed and added file as modified (issue4458)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23037
diff changeset
   517
This is buggy behavior.
2963d5c9d90b rename: properly report removed and added file as modified (issue4458)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23037
diff changeset
   518
2963d5c9d90b rename: properly report removed and added file as modified (issue4458)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23037
diff changeset
   519
  $ hg commit -m 'blah'
2963d5c9d90b rename: properly report removed and added file as modified (issue4458)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23037
diff changeset
   520
  $ hg st --copies --change .
2963d5c9d90b rename: properly report removed and added file as modified (issue4458)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23037
diff changeset
   521
  M a
2963d5c9d90b rename: properly report removed and added file as modified (issue4458)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23037
diff changeset
   522
  R b
2963d5c9d90b rename: properly report removed and added file as modified (issue4458)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23037
diff changeset
   523
2963d5c9d90b rename: properly report removed and added file as modified (issue4458)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23037
diff changeset
   524
  $ cd ..