annotate tests/test-remove.t @ 24715:1439bacf0ec7

json: implement {fileannotate} template
author Gregory Szorc <gregory.szorc@gmail.com>
date Fri, 10 Apr 2015 22:37:40 -0400
parents e033a7d444ac
children 8cc51c5a9365
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
1 $ remove() {
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
2 > hg rm $@
19381
e033a7d444ac tests: do not skip code-checking on some whole files
Simon Heimberg <simohe@besonet.ch>
parents: 18053
diff changeset
3 > echo "exit code: $?"
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
4 > hg st
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
5 > # do not use ls -R, which recurses in .hg subdirs on Mac OS X 10.5
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
6 > find . -name .hg -prune -o -type f -print | sort
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
7 > hg up -C
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
8 > }
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
9
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
10 $ hg init a
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
11 $ cd a
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
12 $ echo a > foo
936
b62d1e738fa9 Add a simple remove test
mpm@selenic.com
parents:
diff changeset
13
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
14 file not managed
6346
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
15
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
16 $ remove foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
17 not removing foo: file is untracked
12130
48735ce02345 merge with stable
Martin Geisler <mg@lazybytes.net>
parents: 12129 12099
diff changeset
18 exit code: 1
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
19 ? foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
20 ./foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
21 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
22
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
23 $ hg add foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
24 $ hg commit -m1
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
25
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
26 the table cases
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
27 00 state added, options none
6346
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
28
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
29 $ echo b > bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
30 $ hg add bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
31 $ remove bar
15115
c84b3f42d5ae remove: suggest forget to undo adds
Matt Mackall <mpm@selenic.com>
parents: 12365
diff changeset
32 not removing bar: file has been marked for add (use forget to undo)
12130
48735ce02345 merge with stable
Martin Geisler <mg@lazybytes.net>
parents: 12129 12099
diff changeset
33 exit code: 1
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
34 A bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
35 ./bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
36 ./foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
37 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
6346
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
38
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
39 01 state clean, options none
6346
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
40
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
41 $ remove foo
12130
48735ce02345 merge with stable
Martin Geisler <mg@lazybytes.net>
parents: 12129 12099
diff changeset
42 exit code: 0
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
43 R foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
44 ? bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
45 ./bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
46 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
47
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
48 02 state modified, options none
6346
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
49
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
50 $ echo b >> foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
51 $ remove foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
52 not removing foo: file is modified (use -f to force removal)
12130
48735ce02345 merge with stable
Martin Geisler <mg@lazybytes.net>
parents: 12129 12099
diff changeset
53 exit code: 1
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
54 M foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
55 ? bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
56 ./bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
57 ./foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
58 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
59
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
60 03 state missing, options none
6346
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
61
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
62 $ rm foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
63 $ remove foo
12130
48735ce02345 merge with stable
Martin Geisler <mg@lazybytes.net>
parents: 12129 12099
diff changeset
64 exit code: 0
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
65 R foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
66 ? bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
67 ./bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
68 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
69
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
70 10 state added, options -f
6346
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
71
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
72 $ echo b > bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
73 $ hg add bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
74 $ remove -f bar
12130
48735ce02345 merge with stable
Martin Geisler <mg@lazybytes.net>
parents: 12129 12099
diff changeset
75 exit code: 0
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
76 ? bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
77 ./bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
78 ./foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
79 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
80 $ rm bar
6346
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
81
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
82 11 state clean, options -f
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
83
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
84 $ remove -f foo
12130
48735ce02345 merge with stable
Martin Geisler <mg@lazybytes.net>
parents: 12129 12099
diff changeset
85 exit code: 0
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
86 R foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
87 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
88
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
89 12 state modified, options -f
6346
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
90
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
91 $ echo b >> foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
92 $ remove -f foo
12130
48735ce02345 merge with stable
Martin Geisler <mg@lazybytes.net>
parents: 12129 12099
diff changeset
93 exit code: 0
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
94 R foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
95 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
96
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
97 13 state missing, options -f
6346
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
98
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
99 $ rm foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
100 $ remove -f foo
12130
48735ce02345 merge with stable
Martin Geisler <mg@lazybytes.net>
parents: 12129 12099
diff changeset
101 exit code: 0
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
102 R foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
103 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
104
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
105 20 state added, options -A
6346
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
106
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
107 $ echo b > bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
108 $ hg add bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
109 $ remove -A bar
18053
0c2f0048125d rm: drop misleading 'use -f' hint for the rm --after 'not removing' warning
Mads Kiilerich <madski@unity3d.com>
parents: 17862
diff changeset
110 not removing bar: file still exists
12130
48735ce02345 merge with stable
Martin Geisler <mg@lazybytes.net>
parents: 12129 12099
diff changeset
111 exit code: 1
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
112 A bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
113 ./bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
114 ./foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
115 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
6346
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
116
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
117 21 state clean, options -A
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
118
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
119 $ remove -A foo
18053
0c2f0048125d rm: drop misleading 'use -f' hint for the rm --after 'not removing' warning
Mads Kiilerich <madski@unity3d.com>
parents: 17862
diff changeset
120 not removing foo: file still exists
12130
48735ce02345 merge with stable
Martin Geisler <mg@lazybytes.net>
parents: 12129 12099
diff changeset
121 exit code: 1
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
122 ? bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
123 ./bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
124 ./foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
125 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
126
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
127 22 state modified, options -A
936
b62d1e738fa9 Add a simple remove test
mpm@selenic.com
parents:
diff changeset
128
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
129 $ echo b >> foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
130 $ remove -A foo
18053
0c2f0048125d rm: drop misleading 'use -f' hint for the rm --after 'not removing' warning
Mads Kiilerich <madski@unity3d.com>
parents: 17862
diff changeset
131 not removing foo: file still exists
12130
48735ce02345 merge with stable
Martin Geisler <mg@lazybytes.net>
parents: 12129 12099
diff changeset
132 exit code: 1
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
133 M foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
134 ? bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
135 ./bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
136 ./foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
137 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
6346
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
138
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
139 23 state missing, options -A
6346
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
140
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
141 $ rm foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
142 $ remove -A foo
12130
48735ce02345 merge with stable
Martin Geisler <mg@lazybytes.net>
parents: 12129 12099
diff changeset
143 exit code: 0
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
144 R foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
145 ? bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
146 ./bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
147 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
148
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
149 30 state added, options -Af
6346
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
150
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
151 $ echo b > bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
152 $ hg add bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
153 $ remove -Af bar
12130
48735ce02345 merge with stable
Martin Geisler <mg@lazybytes.net>
parents: 12129 12099
diff changeset
154 exit code: 0
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
155 ? bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
156 ./bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
157 ./foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
158 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
159 $ rm bar
6346
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
160
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
161 31 state clean, options -Af
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
162
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
163 $ remove -Af foo
12130
48735ce02345 merge with stable
Martin Geisler <mg@lazybytes.net>
parents: 12129 12099
diff changeset
164 exit code: 0
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
165 R foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
166 ./foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
167 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
6346
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
168
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
169 32 state modified, options -Af
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
170
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
171 $ echo b >> foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
172 $ remove -Af foo
12130
48735ce02345 merge with stable
Martin Geisler <mg@lazybytes.net>
parents: 12129 12099
diff changeset
173 exit code: 0
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
174 R foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
175 ./foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
176 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
2309
b2f37c7026ca remove: rewrite to be ~400x faster, bit more friendly
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2180
diff changeset
177
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
178 33 state missing, options -Af
6346
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
179
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
180 $ rm foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
181 $ remove -Af foo
12130
48735ce02345 merge with stable
Martin Geisler <mg@lazybytes.net>
parents: 12129 12099
diff changeset
182 exit code: 0
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
183 R foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
184 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
185
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
186 test some directory stuff
6346
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
187
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
188 $ mkdir test
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
189 $ echo a > test/foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
190 $ echo b > test/bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
191 $ hg ci -Am2
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
192 adding test/bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
193 adding test/foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
194
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
195 dir, options none
6346
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
196
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
197 $ rm test/bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
198 $ remove test
15447
9910f60a37ee tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents: 15115
diff changeset
199 removing test/bar (glob)
9910f60a37ee tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents: 15115
diff changeset
200 removing test/foo (glob)
12130
48735ce02345 merge with stable
Martin Geisler <mg@lazybytes.net>
parents: 12129 12099
diff changeset
201 exit code: 0
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
202 R test/bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
203 R test/foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
204 ./foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
205 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
206
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
207 dir, options -f
6346
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
208
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
209 $ rm test/bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
210 $ remove -f test
15447
9910f60a37ee tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents: 15115
diff changeset
211 removing test/bar (glob)
9910f60a37ee tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents: 15115
diff changeset
212 removing test/foo (glob)
12130
48735ce02345 merge with stable
Martin Geisler <mg@lazybytes.net>
parents: 12129 12099
diff changeset
213 exit code: 0
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
214 R test/bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
215 R test/foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
216 ./foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
217 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
218
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
219 dir, options -A
6346
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
220
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
221 $ rm test/bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
222 $ remove -A test
18053
0c2f0048125d rm: drop misleading 'use -f' hint for the rm --after 'not removing' warning
Mads Kiilerich <madski@unity3d.com>
parents: 17862
diff changeset
223 not removing test/foo: file still exists (glob)
15447
9910f60a37ee tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents: 15115
diff changeset
224 removing test/bar (glob)
12130
48735ce02345 merge with stable
Martin Geisler <mg@lazybytes.net>
parents: 12129 12099
diff changeset
225 exit code: 1
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
226 R test/bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
227 ./foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
228 ./test/foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
229 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
6346
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
230
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
231 dir, options -Af
9572
1f665246dab3 windows: fix unlink() not dropping empty tree (issue1861)
Patrick Mezard <pmezard@gmail.com>
parents: 6358
diff changeset
232
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
233 $ rm test/bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
234 $ remove -Af test
15447
9910f60a37ee tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents: 15115
diff changeset
235 removing test/bar (glob)
9910f60a37ee tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents: 15115
diff changeset
236 removing test/foo (glob)
12130
48735ce02345 merge with stable
Martin Geisler <mg@lazybytes.net>
parents: 12129 12099
diff changeset
237 exit code: 0
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
238 R test/bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
239 R test/foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
240 ./foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
241 ./test/foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
242 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
243
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
244 test remove dropping empty trees (issue1861)
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
245
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
246 $ mkdir -p issue1861/b/c
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
247 $ echo x > issue1861/x
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
248 $ echo y > issue1861/b/c/y
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
249 $ hg ci -Am add
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
250 adding issue1861/b/c/y
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
251 adding issue1861/x
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
252 $ hg rm issue1861/b
15447
9910f60a37ee tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents: 15115
diff changeset
253 removing issue1861/b/c/y (glob)
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
254 $ hg ci -m remove
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
255 $ ls issue1861
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
256 x
16904
9d0f988364bd test-remove-new: integrate into test-remove.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 15447
diff changeset
257
9d0f988364bd test-remove-new: integrate into test-remove.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 15447
diff changeset
258 test that commit does not crash if the user removes a newly added file
9d0f988364bd test-remove-new: integrate into test-remove.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 15447
diff changeset
259
9d0f988364bd test-remove-new: integrate into test-remove.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 15447
diff changeset
260 $ touch f1
9d0f988364bd test-remove-new: integrate into test-remove.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 15447
diff changeset
261 $ hg add f1
9d0f988364bd test-remove-new: integrate into test-remove.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 15447
diff changeset
262 $ rm f1
9d0f988364bd test-remove-new: integrate into test-remove.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 15447
diff changeset
263 $ hg ci -A -mx
9d0f988364bd test-remove-new: integrate into test-remove.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 15447
diff changeset
264 removing f1
9d0f988364bd test-remove-new: integrate into test-remove.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 15447
diff changeset
265 nothing changed
9d0f988364bd test-remove-new: integrate into test-remove.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 15447
diff changeset
266 [1]
16913
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 16904
diff changeset
267
17848
66f0c78350ab remove: don't return error on directories with tracked files
Matt Mackall <mpm@selenic.com>
parents: 16913
diff changeset
268 handling of untracked directories and missing files
66f0c78350ab remove: don't return error on directories with tracked files
Matt Mackall <mpm@selenic.com>
parents: 16913
diff changeset
269
66f0c78350ab remove: don't return error on directories with tracked files
Matt Mackall <mpm@selenic.com>
parents: 16913
diff changeset
270 $ mkdir d1
66f0c78350ab remove: don't return error on directories with tracked files
Matt Mackall <mpm@selenic.com>
parents: 16913
diff changeset
271 $ echo a > d1/a
66f0c78350ab remove: don't return error on directories with tracked files
Matt Mackall <mpm@selenic.com>
parents: 16913
diff changeset
272 $ hg rm --after d1
66f0c78350ab remove: don't return error on directories with tracked files
Matt Mackall <mpm@selenic.com>
parents: 16913
diff changeset
273 not removing d1: no tracked files
66f0c78350ab remove: don't return error on directories with tracked files
Matt Mackall <mpm@selenic.com>
parents: 16913
diff changeset
274 [1]
66f0c78350ab remove: don't return error on directories with tracked files
Matt Mackall <mpm@selenic.com>
parents: 16913
diff changeset
275 $ hg add d1/a
66f0c78350ab remove: don't return error on directories with tracked files
Matt Mackall <mpm@selenic.com>
parents: 16913
diff changeset
276 $ rm d1/a
66f0c78350ab remove: don't return error on directories with tracked files
Matt Mackall <mpm@selenic.com>
parents: 16913
diff changeset
277 $ hg rm --after d1
17861
3125af2d99d2 test-remove: fix \ vs. / issues on Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 17848
diff changeset
278 removing d1/a (glob)
17862
2142691be14f test-remove: adapt to differing error message on Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 17861
diff changeset
279 #if windows
2142691be14f test-remove: adapt to differing error message on Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 17861
diff changeset
280 $ hg rm --after nosuch
2142691be14f test-remove: adapt to differing error message on Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 17861
diff changeset
281 nosuch: * (glob)
2142691be14f test-remove: adapt to differing error message on Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 17861
diff changeset
282 [1]
2142691be14f test-remove: adapt to differing error message on Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 17861
diff changeset
283 #else
17848
66f0c78350ab remove: don't return error on directories with tracked files
Matt Mackall <mpm@selenic.com>
parents: 16913
diff changeset
284 $ hg rm --after nosuch
66f0c78350ab remove: don't return error on directories with tracked files
Matt Mackall <mpm@selenic.com>
parents: 16913
diff changeset
285 nosuch: No such file or directory
66f0c78350ab remove: don't return error on directories with tracked files
Matt Mackall <mpm@selenic.com>
parents: 16913
diff changeset
286 [1]
17862
2142691be14f test-remove: adapt to differing error message on Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 17861
diff changeset
287 #endif