##// END OF EJS Templates
test-automv: fix inline config settings for 5ec1ce8fdf0a
Augie Fackler -
r28184:11c2f8af default
parent child Browse files
Show More
@@ -1,338 +1,338
1 Tests for the automv extension; detect moved files at commit time.
1 Tests for the automv extension; detect moved files at commit time.
2
2
3 $ cat >> $HGRCPATH << EOF
3 $ cat >> $HGRCPATH << EOF
4 > [extensions]
4 > [extensions]
5 > automv=
5 > automv=
6 > rebase=
6 > rebase=
7 > EOF
7 > EOF
8
8
9 Setup repo
9 Setup repo
10
10
11 $ hg init repo
11 $ hg init repo
12 $ cd repo
12 $ cd repo
13
13
14 Test automv command for commit
14 Test automv command for commit
15
15
16 $ printf 'foo\nbar\nbaz\n' > a.txt
16 $ printf 'foo\nbar\nbaz\n' > a.txt
17 $ hg add a.txt
17 $ hg add a.txt
18 $ hg commit -m 'init repo with a'
18 $ hg commit -m 'init repo with a'
19
19
20 mv/rm/add
20 mv/rm/add
21 $ mv a.txt b.txt
21 $ mv a.txt b.txt
22 $ hg rm a.txt
22 $ hg rm a.txt
23 $ hg add b.txt
23 $ hg add b.txt
24 $ hg status -C
24 $ hg status -C
25 A b.txt
25 A b.txt
26 R a.txt
26 R a.txt
27 $ hg commit -m 'msg'
27 $ hg commit -m 'msg'
28 detected move of 1 files
28 detected move of 1 files
29 $ hg status --change . -C
29 $ hg status --change . -C
30 A b.txt
30 A b.txt
31 a.txt
31 a.txt
32 R a.txt
32 R a.txt
33 $ hg up -r 0
33 $ hg up -r 0
34 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
34 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
35
35
36 mv/rm/add/modif
36 mv/rm/add/modif
37 $ mv a.txt b.txt
37 $ mv a.txt b.txt
38 $ hg rm a.txt
38 $ hg rm a.txt
39 $ hg add b.txt
39 $ hg add b.txt
40 $ printf '\n' >> b.txt
40 $ printf '\n' >> b.txt
41 $ hg status -C
41 $ hg status -C
42 A b.txt
42 A b.txt
43 R a.txt
43 R a.txt
44 $ hg commit -m 'msg'
44 $ hg commit -m 'msg'
45 detected move of 1 files
45 detected move of 1 files
46 created new head
46 created new head
47 $ hg status --change . -C
47 $ hg status --change . -C
48 A b.txt
48 A b.txt
49 a.txt
49 a.txt
50 R a.txt
50 R a.txt
51 $ hg up -r 0
51 $ hg up -r 0
52 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
52 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
53
53
54 mv/rm/add/modif
54 mv/rm/add/modif
55 $ mv a.txt b.txt
55 $ mv a.txt b.txt
56 $ hg rm a.txt
56 $ hg rm a.txt
57 $ hg add b.txt
57 $ hg add b.txt
58 $ printf '\nfoo\n' >> b.txt
58 $ printf '\nfoo\n' >> b.txt
59 $ hg status -C
59 $ hg status -C
60 A b.txt
60 A b.txt
61 R a.txt
61 R a.txt
62 $ hg commit -m 'msg'
62 $ hg commit -m 'msg'
63 created new head
63 created new head
64 $ hg status --change . -C
64 $ hg status --change . -C
65 A b.txt
65 A b.txt
66 R a.txt
66 R a.txt
67 $ hg up -r 0
67 $ hg up -r 0
68 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
68 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
69
69
70 mv/rm/add/modif/changethreshold
70 mv/rm/add/modif/changethreshold
71 $ mv a.txt b.txt
71 $ mv a.txt b.txt
72 $ hg rm a.txt
72 $ hg rm a.txt
73 $ hg add b.txt
73 $ hg add b.txt
74 $ printf '\nfoo\n' >> b.txt
74 $ printf '\nfoo\n' >> b.txt
75 $ hg status -C
75 $ hg status -C
76 A b.txt
76 A b.txt
77 R a.txt
77 R a.txt
78 $ hg commit --config automv.similarity='0.6' -m 'msg'
78 $ hg commit --config automv.similarity='60' -m 'msg'
79 detected move of 1 files
79 detected move of 1 files
80 created new head
80 created new head
81 $ hg status --change . -C
81 $ hg status --change . -C
82 A b.txt
82 A b.txt
83 a.txt
83 a.txt
84 R a.txt
84 R a.txt
85 $ hg up -r 0
85 $ hg up -r 0
86 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
86 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
87
87
88 mv
88 mv
89 $ mv a.txt b.txt
89 $ mv a.txt b.txt
90 $ hg status -C
90 $ hg status -C
91 ! a.txt
91 ! a.txt
92 ? b.txt
92 ? b.txt
93 $ hg commit -m 'msg'
93 $ hg commit -m 'msg'
94 nothing changed (1 missing files, see 'hg status')
94 nothing changed (1 missing files, see 'hg status')
95 [1]
95 [1]
96 $ hg status -C
96 $ hg status -C
97 ! a.txt
97 ! a.txt
98 ? b.txt
98 ? b.txt
99 $ hg revert -aqC
99 $ hg revert -aqC
100 $ rm b.txt
100 $ rm b.txt
101
101
102 mv/rm/add/notincommitfiles
102 mv/rm/add/notincommitfiles
103 $ mv a.txt b.txt
103 $ mv a.txt b.txt
104 $ hg rm a.txt
104 $ hg rm a.txt
105 $ hg add b.txt
105 $ hg add b.txt
106 $ echo 'bar' > c.txt
106 $ echo 'bar' > c.txt
107 $ hg add c.txt
107 $ hg add c.txt
108 $ hg status -C
108 $ hg status -C
109 A b.txt
109 A b.txt
110 A c.txt
110 A c.txt
111 R a.txt
111 R a.txt
112 $ hg commit c.txt -m 'msg'
112 $ hg commit c.txt -m 'msg'
113 created new head
113 created new head
114 $ hg status --change . -C
114 $ hg status --change . -C
115 A c.txt
115 A c.txt
116 $ hg status -C
116 $ hg status -C
117 A b.txt
117 A b.txt
118 R a.txt
118 R a.txt
119 $ hg up -r 0
119 $ hg up -r 0
120 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
120 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
121 $ hg rm a.txt
121 $ hg rm a.txt
122 $ echo 'bar' > c.txt
122 $ echo 'bar' > c.txt
123 $ hg add c.txt
123 $ hg add c.txt
124 $ hg commit -m 'msg'
124 $ hg commit -m 'msg'
125 detected move of 1 files
125 detected move of 1 files
126 created new head
126 created new head
127 $ hg status --change . -C
127 $ hg status --change . -C
128 A b.txt
128 A b.txt
129 a.txt
129 a.txt
130 A c.txt
130 A c.txt
131 R a.txt
131 R a.txt
132 $ hg up -r 0
132 $ hg up -r 0
133 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
133 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
134
134
135 mv/rm/add/--no-automv
135 mv/rm/add/--no-automv
136 $ mv a.txt b.txt
136 $ mv a.txt b.txt
137 $ hg rm a.txt
137 $ hg rm a.txt
138 $ hg add b.txt
138 $ hg add b.txt
139 $ hg status -C
139 $ hg status -C
140 A b.txt
140 A b.txt
141 R a.txt
141 R a.txt
142 $ hg commit --no-automv -m 'msg'
142 $ hg commit --no-automv -m 'msg'
143 created new head
143 created new head
144 $ hg status --change . -C
144 $ hg status --change . -C
145 A b.txt
145 A b.txt
146 R a.txt
146 R a.txt
147 $ hg up -r 0
147 $ hg up -r 0
148 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
148 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
149
149
150 Test automv command for commit --amend
150 Test automv command for commit --amend
151
151
152 mv/rm/add
152 mv/rm/add
153 $ echo 'c' > c.txt
153 $ echo 'c' > c.txt
154 $ hg add c.txt
154 $ hg add c.txt
155 $ hg commit -m 'revision to amend to'
155 $ hg commit -m 'revision to amend to'
156 created new head
156 created new head
157 $ mv a.txt b.txt
157 $ mv a.txt b.txt
158 $ hg rm a.txt
158 $ hg rm a.txt
159 $ hg add b.txt
159 $ hg add b.txt
160 $ hg status -C
160 $ hg status -C
161 A b.txt
161 A b.txt
162 R a.txt
162 R a.txt
163 $ hg commit --amend -m 'amended'
163 $ hg commit --amend -m 'amended'
164 detected move of 1 files
164 detected move of 1 files
165 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/*-amend-backup.hg (glob)
165 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/*-amend-backup.hg (glob)
166 $ hg status --change . -C
166 $ hg status --change . -C
167 A b.txt
167 A b.txt
168 a.txt
168 a.txt
169 A c.txt
169 A c.txt
170 R a.txt
170 R a.txt
171 $ hg up -r 0
171 $ hg up -r 0
172 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
172 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
173
173
174 mv/rm/add/modif
174 mv/rm/add/modif
175 $ echo 'c' > c.txt
175 $ echo 'c' > c.txt
176 $ hg add c.txt
176 $ hg add c.txt
177 $ hg commit -m 'revision to amend to'
177 $ hg commit -m 'revision to amend to'
178 created new head
178 created new head
179 $ mv a.txt b.txt
179 $ mv a.txt b.txt
180 $ hg rm a.txt
180 $ hg rm a.txt
181 $ hg add b.txt
181 $ hg add b.txt
182 $ printf '\n' >> b.txt
182 $ printf '\n' >> b.txt
183 $ hg status -C
183 $ hg status -C
184 A b.txt
184 A b.txt
185 R a.txt
185 R a.txt
186 $ hg commit --amend -m 'amended'
186 $ hg commit --amend -m 'amended'
187 detected move of 1 files
187 detected move of 1 files
188 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/*-amend-backup.hg (glob)
188 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/*-amend-backup.hg (glob)
189 $ hg status --change . -C
189 $ hg status --change . -C
190 A b.txt
190 A b.txt
191 a.txt
191 a.txt
192 A c.txt
192 A c.txt
193 R a.txt
193 R a.txt
194 $ hg up -r 0
194 $ hg up -r 0
195 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
195 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
196
196
197 mv/rm/add/modif
197 mv/rm/add/modif
198 $ echo 'c' > c.txt
198 $ echo 'c' > c.txt
199 $ hg add c.txt
199 $ hg add c.txt
200 $ hg commit -m 'revision to amend to'
200 $ hg commit -m 'revision to amend to'
201 created new head
201 created new head
202 $ mv a.txt b.txt
202 $ mv a.txt b.txt
203 $ hg rm a.txt
203 $ hg rm a.txt
204 $ hg add b.txt
204 $ hg add b.txt
205 $ printf '\nfoo\n' >> b.txt
205 $ printf '\nfoo\n' >> b.txt
206 $ hg status -C
206 $ hg status -C
207 A b.txt
207 A b.txt
208 R a.txt
208 R a.txt
209 $ hg commit --amend -m 'amended'
209 $ hg commit --amend -m 'amended'
210 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/*-amend-backup.hg (glob)
210 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/*-amend-backup.hg (glob)
211 $ hg status --change . -C
211 $ hg status --change . -C
212 A b.txt
212 A b.txt
213 A c.txt
213 A c.txt
214 R a.txt
214 R a.txt
215 $ hg up -r 0
215 $ hg up -r 0
216 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
216 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
217
217
218 mv/rm/add/modif/changethreshold
218 mv/rm/add/modif/changethreshold
219 $ echo 'c' > c.txt
219 $ echo 'c' > c.txt
220 $ hg add c.txt
220 $ hg add c.txt
221 $ hg commit -m 'revision to amend to'
221 $ hg commit -m 'revision to amend to'
222 created new head
222 created new head
223 $ mv a.txt b.txt
223 $ mv a.txt b.txt
224 $ hg rm a.txt
224 $ hg rm a.txt
225 $ hg add b.txt
225 $ hg add b.txt
226 $ printf '\nfoo\n' >> b.txt
226 $ printf '\nfoo\n' >> b.txt
227 $ hg status -C
227 $ hg status -C
228 A b.txt
228 A b.txt
229 R a.txt
229 R a.txt
230 $ hg commit --amend --config automv.similarity='0.6' -m 'amended'
230 $ hg commit --amend --config automv.similarity='60' -m 'amended'
231 detected move of 1 files
231 detected move of 1 files
232 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/*-amend-backup.hg (glob)
232 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/*-amend-backup.hg (glob)
233 $ hg status --change . -C
233 $ hg status --change . -C
234 A b.txt
234 A b.txt
235 a.txt
235 a.txt
236 A c.txt
236 A c.txt
237 R a.txt
237 R a.txt
238 $ hg up -r 0
238 $ hg up -r 0
239 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
239 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
240
240
241 mv
241 mv
242 $ echo 'c' > c.txt
242 $ echo 'c' > c.txt
243 $ hg add c.txt
243 $ hg add c.txt
244 $ hg commit -m 'revision to amend to'
244 $ hg commit -m 'revision to amend to'
245 created new head
245 created new head
246 $ mv a.txt b.txt
246 $ mv a.txt b.txt
247 $ hg status -C
247 $ hg status -C
248 ! a.txt
248 ! a.txt
249 ? b.txt
249 ? b.txt
250 $ hg commit --amend -m 'amended'
250 $ hg commit --amend -m 'amended'
251 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/*-amend-backup.hg (glob)
251 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/*-amend-backup.hg (glob)
252 $ hg status -C
252 $ hg status -C
253 ! a.txt
253 ! a.txt
254 ? b.txt
254 ? b.txt
255 $ hg up -Cr 0
255 $ hg up -Cr 0
256 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
256 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
257
257
258 mv/rm/add/notincommitfiles
258 mv/rm/add/notincommitfiles
259 $ echo 'c' > c.txt
259 $ echo 'c' > c.txt
260 $ hg add c.txt
260 $ hg add c.txt
261 $ hg commit -m 'revision to amend to'
261 $ hg commit -m 'revision to amend to'
262 created new head
262 created new head
263 $ mv a.txt b.txt
263 $ mv a.txt b.txt
264 $ hg rm a.txt
264 $ hg rm a.txt
265 $ hg add b.txt
265 $ hg add b.txt
266 $ echo 'bar' > d.txt
266 $ echo 'bar' > d.txt
267 $ hg add d.txt
267 $ hg add d.txt
268 $ hg status -C
268 $ hg status -C
269 A b.txt
269 A b.txt
270 A d.txt
270 A d.txt
271 R a.txt
271 R a.txt
272 $ hg commit --amend -m 'amended' d.txt
272 $ hg commit --amend -m 'amended' d.txt
273 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/*-amend-backup.hg (glob)
273 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/*-amend-backup.hg (glob)
274 $ hg status --change . -C
274 $ hg status --change . -C
275 A c.txt
275 A c.txt
276 A d.txt
276 A d.txt
277 $ hg status -C
277 $ hg status -C
278 A b.txt
278 A b.txt
279 R a.txt
279 R a.txt
280 $ hg commit --amend -m 'amended'
280 $ hg commit --amend -m 'amended'
281 detected move of 1 files
281 detected move of 1 files
282 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/*-amend-backup.hg (glob)
282 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/*-amend-backup.hg (glob)
283 $ hg status --change . -C
283 $ hg status --change . -C
284 A b.txt
284 A b.txt
285 a.txt
285 a.txt
286 A c.txt
286 A c.txt
287 A d.txt
287 A d.txt
288 R a.txt
288 R a.txt
289 $ hg up -r 0
289 $ hg up -r 0
290 1 files updated, 0 files merged, 3 files removed, 0 files unresolved
290 1 files updated, 0 files merged, 3 files removed, 0 files unresolved
291
291
292 mv/rm/add/--no-automv
292 mv/rm/add/--no-automv
293 $ echo 'c' > c.txt
293 $ echo 'c' > c.txt
294 $ hg add c.txt
294 $ hg add c.txt
295 $ hg commit -m 'revision to amend to'
295 $ hg commit -m 'revision to amend to'
296 created new head
296 created new head
297 $ mv a.txt b.txt
297 $ mv a.txt b.txt
298 $ hg rm a.txt
298 $ hg rm a.txt
299 $ hg add b.txt
299 $ hg add b.txt
300 $ hg status -C
300 $ hg status -C
301 A b.txt
301 A b.txt
302 R a.txt
302 R a.txt
303 $ hg commit --amend -m 'amended' --no-automv
303 $ hg commit --amend -m 'amended' --no-automv
304 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/*-amend-backup.hg (glob)
304 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/*-amend-backup.hg (glob)
305 $ hg status --change . -C
305 $ hg status --change . -C
306 A b.txt
306 A b.txt
307 A c.txt
307 A c.txt
308 R a.txt
308 R a.txt
309 $ hg up -r 0
309 $ hg up -r 0
310 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
310 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
311
311
312 mv/rm/commit/add/amend
312 mv/rm/commit/add/amend
313 $ echo 'c' > c.txt
313 $ echo 'c' > c.txt
314 $ hg add c.txt
314 $ hg add c.txt
315 $ hg commit -m 'revision to amend to'
315 $ hg commit -m 'revision to amend to'
316 created new head
316 created new head
317 $ mv a.txt b.txt
317 $ mv a.txt b.txt
318 $ hg rm a.txt
318 $ hg rm a.txt
319 $ hg status -C
319 $ hg status -C
320 R a.txt
320 R a.txt
321 ? b.txt
321 ? b.txt
322 $ hg commit -m "removed a"
322 $ hg commit -m "removed a"
323 $ hg add b.txt
323 $ hg add b.txt
324 $ hg commit --amend -m 'amended'
324 $ hg commit --amend -m 'amended'
325 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/*-amend-backup.hg (glob)
325 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/*-amend-backup.hg (glob)
326 $ hg status --change . -C
326 $ hg status --change . -C
327 A b.txt
327 A b.txt
328 R a.txt
328 R a.txt
329
329
330 error conditions
330 error conditions
331
331
332 $ cat >> $HGRCPATH << EOF
332 $ cat >> $HGRCPATH << EOF
333 > [automv]
333 > [automv]
334 > similarity=110
334 > similarity=110
335 > EOF
335 > EOF
336 $ hg commit -m 'revision to amend to'
336 $ hg commit -m 'revision to amend to'
337 abort: automv.similarity must be between 0 and 100
337 abort: automv.similarity must be between 0 and 100
338 [255]
338 [255]
General Comments 0
You need to be logged in to leave comments. Login now