annotate tests/test-status.t @ 11989:f853873fc66d

aliases: provide more flexible ways to work with shell alias arguments This patch changes the functionality of shell aliases to add more powerful options for working with shell alias arguments. First: the alias name + arguments to a shell alias are set as an HG_ARGS environment variable, delimited by spaces. This matches the behavior of hooks. Second: any occurrences of "$@" (without quotes) are replaced with the arguments, separated by spaces. This happens *before* the alias gets to the shell. Third: any positive numeric variables ("$1", "$2", etc) are replaced with the appropriate argument, indexed from 1. "$0" is replaced with the name of the alias. Any "extra" numeric variables are replaced with an empty string. This happens *before* the alias gets to the shell. These changes allow for more flexible shell aliases: [alias] echo = !echo $@ count = !hg log -r "$@" --template='.' | wc -c | sed -e 's/ //g' qqueuemv = !mv "`hg root`/.hg/patches-$1" "`hg root`/.hg/patches-$2" In action: $ hg echo foo foo $ hg count 'branch(default)' 901 $ hg count 'branch(stable) and keyword(fixes)' 102 $ hg qqueuemv myfeature somefeature
author Steve Losh <steve@stevelosh.com>
date Wed, 18 Aug 2010 18:56:44 -0400
parents 992506c14217
children 4c94b6d0fb1c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
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
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
109 $ hg ci -A -m 'initial checkin' -d "1000000 0"
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
acc40572da5b 'hg status -q' output skips non-tracked files.
Zoran Bosnjak <zoran.bosnjak@via.si>
parents: 6033
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
acc40572da5b 'hg status -q' output skips non-tracked files.
Zoran Bosnjak <zoran.bosnjak@via.si>
parents: 6033
diff changeset
194 # Run status with 2 different flags.
acc40572da5b 'hg status -q' output skips non-tracked files.
Zoran Bosnjak <zoran.bosnjak@via.si>
parents: 6033
diff changeset
195 # Check if result is the same or different.
acc40572da5b 'hg status -q' output skips non-tracked files.
Zoran Bosnjak <zoran.bosnjak@via.si>
parents: 6033
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() {
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
199 > hg status $1 > ../a
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
200 > hg status $2 > ../b
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
201 > out=`diff ../a ../b`
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
202 > if [ $? -ne 0 ]; then
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
203 > out=1
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
204 > else
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
205 > out=0
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
206 > fi
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
207 > if [ $3 -eq 0 ]; then
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
208 > df="same"
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
209 > else
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
210 > df="different"
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
211 > fi
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
212 > if [ $out -ne $3 ]; then
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
213 > echo "Error on $1 and $2, should be $df."
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
214 > fi
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
215 > }
6200
acc40572da5b 'hg status -q' output skips non-tracked files.
Zoran Bosnjak <zoran.bosnjak@via.si>
parents: 6033
diff changeset
216
acc40572da5b 'hg status -q' output skips non-tracked files.
Zoran Bosnjak <zoran.bosnjak@via.si>
parents: 6033
diff changeset
217 # assert flag1 flag2 [0-same | 1-different]
11782
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
218
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
219 $ assert "-q" "-mard" 0
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
220 $ assert "-A" "-marduicC" 0
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
221 $ assert "-qA" "-mardcC" 0
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
222 $ assert "-qAui" "-A" 0
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
223 $ assert "-qAu" "-marducC" 0
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
224 $ assert "-qAi" "-mardicC" 0
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
225 $ assert "-qu" "-u" 0
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
226 $ assert "-q" "-u" 1
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
227 $ assert "-m" "-a" 1
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
228 $ assert "-r" "-d" 1
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
229 $ cd ..
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
230
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
231 $ hg init repo4
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
232 $ cd repo4
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
233 $ touch modified removed deleted
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
234 $ hg ci -q -A -m 'initial checkin' -d "1000000 0"
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
235 $ touch added unknown
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
236 $ hg add added
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
237 $ hg remove removed
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
238 $ rm deleted
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
239 $ echo x > modified
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
240 $ hg copy modified copied
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
241 $ hg ci -m 'test checkin' -d "1000001 0"
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
242 $ rm *
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
243 $ touch unrelated
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
244 $ 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
245
11782
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
246 hg status --change 1:
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 --change 1
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
249 M modified
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
250 A added
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
251 A copied
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
252 R removed
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 status --change 1 unrelated:
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
255
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
256 $ hg status --change 1 unrelated
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
257
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
258 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
259
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
260 $ 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
261 M modified
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
262 A added
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
263 A copied
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
264 modified
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
265 R removed
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
266
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
267 hg status -A --change 1:
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
268
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
269 $ hg status -A --change 1
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
270 M modified
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
271 A added
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
272 A copied
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
273 modified
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
274 R removed
992506c14217 tests: unify test-status
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10014
diff changeset
275 C deleted