Mercurial > hg-stable
comparison tests/test-commit.t @ 12316:4134686b83e1
tests: add exit codes to unified tests
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Thu, 16 Sep 2010 17:51:32 -0500 |
parents | 4c94b6d0fb1c |
children | 92e30e135581 |
comparison
equal
deleted
inserted
replaced
12315:ca58f6475f1d | 12316:4134686b83e1 |
---|---|
4 $ cd test | 4 $ cd test |
5 $ echo foo > foo | 5 $ echo foo > foo |
6 $ hg add foo | 6 $ hg add foo |
7 $ HGEDITOR=true hg commit -m "" | 7 $ HGEDITOR=true hg commit -m "" |
8 abort: empty commit message | 8 abort: empty commit message |
9 [255] | |
9 $ hg commit -d '0 0' -m commit-1 | 10 $ hg commit -d '0 0' -m commit-1 |
10 $ echo foo >> foo | 11 $ echo foo >> foo |
11 $ hg commit -d '1 4444444' -m commit-3 | 12 $ hg commit -d '1 4444444' -m commit-3 |
12 abort: impossible time zone offset: 4444444 | 13 abort: impossible time zone offset: 4444444 |
14 [255] | |
13 $ hg commit -d '1 15.1' -m commit-4 | 15 $ hg commit -d '1 15.1' -m commit-4 |
14 abort: invalid date: '1\t15.1' | 16 abort: invalid date: '1\t15.1' |
17 [255] | |
15 $ hg commit -d 'foo bar' -m commit-5 | 18 $ hg commit -d 'foo bar' -m commit-5 |
16 abort: invalid date: 'foo bar' | 19 abort: invalid date: 'foo bar' |
20 [255] | |
17 $ hg commit -d ' 1 4444' -m commit-6 | 21 $ hg commit -d ' 1 4444' -m commit-6 |
18 $ hg commit -d '111111111111 0' -m commit-7 | 22 $ hg commit -d '111111111111 0' -m commit-7 |
19 abort: date exceeds 32 bits: 111111111111 | 23 abort: date exceeds 32 bits: 111111111111 |
24 [255] | |
20 | 25 |
21 commit added file that has been deleted | 26 commit added file that has been deleted |
22 | 27 |
23 $ echo bar > bar | 28 $ echo bar > bar |
24 $ hg add bar | 29 $ hg add bar |
25 $ rm bar | 30 $ rm bar |
26 $ hg commit -m commit-8 | 31 $ hg commit -m commit-8 |
27 nothing changed | 32 nothing changed |
33 [1] | |
28 $ hg commit -m commit-8-2 bar | 34 $ hg commit -m commit-8-2 bar |
29 abort: bar: file not found! | 35 abort: bar: file not found! |
36 [255] | |
30 | 37 |
31 $ hg -q revert -a --no-backup | 38 $ hg -q revert -a --no-backup |
32 | 39 |
33 $ mkdir dir | 40 $ mkdir dir |
34 $ echo boo > dir/file | 41 $ echo boo > dir/file |
41 $ echo > dir.file | 48 $ echo > dir.file |
42 $ hg add | 49 $ hg add |
43 adding dir.file | 50 adding dir.file |
44 $ hg commit -m commit-10 dir dir.file | 51 $ hg commit -m commit-10 dir dir.file |
45 abort: dir: no match under directory! | 52 abort: dir: no match under directory! |
53 [255] | |
46 | 54 |
47 $ echo >> dir/file | 55 $ echo >> dir/file |
48 $ mkdir bleh | 56 $ mkdir bleh |
49 $ mkdir dir2 | 57 $ mkdir dir2 |
50 $ cd bleh | 58 $ cd bleh |
51 $ hg commit -m commit-11 . | 59 $ hg commit -m commit-11 . |
52 abort: bleh: no match under directory! | 60 abort: bleh: no match under directory! |
61 [255] | |
53 $ hg commit -m commit-12 ../dir ../dir2 | 62 $ hg commit -m commit-12 ../dir ../dir2 |
54 abort: dir2: no match under directory! | 63 abort: dir2: no match under directory! |
64 [255] | |
55 $ hg -v commit -m commit-13 ../dir | 65 $ hg -v commit -m commit-13 ../dir |
56 dir/file | 66 dir/file |
57 committed changeset 3:1cd62a2d8db5 | 67 committed changeset 3:1cd62a2d8db5 |
58 $ cd .. | 68 $ cd .. |
59 | 69 |
60 $ hg commit -m commit-14 does-not-exist | 70 $ hg commit -m commit-14 does-not-exist |
61 abort: does-not-exist: No such file or directory | 71 abort: does-not-exist: No such file or directory |
72 [255] | |
62 $ ln -s foo baz | 73 $ ln -s foo baz |
63 $ hg commit -m commit-15 baz | 74 $ hg commit -m commit-15 baz |
64 abort: baz: file not tracked! | 75 abort: baz: file not tracked! |
76 [255] | |
65 $ touch quux | 77 $ touch quux |
66 $ hg commit -m commit-16 quux | 78 $ hg commit -m commit-16 quux |
67 abort: quux: file not tracked! | 79 abort: quux: file not tracked! |
80 [255] | |
68 $ echo >> dir/file | 81 $ echo >> dir/file |
69 $ hg -v commit -m commit-17 dir/file | 82 $ hg -v commit -m commit-17 dir/file |
70 dir/file | 83 dir/file |
71 committed changeset 4:49176991390e | 84 committed changeset 4:49176991390e |
72 | 85 |
73 An empty date was interpreted as epoch origin | 86 An empty date was interpreted as epoch origin |
74 | 87 |
75 $ echo foo >> foo | 88 $ echo foo >> foo |
76 $ hg commit -d '' -m commit-no-date | 89 $ hg commit -d '' -m commit-no-date |
77 $ hg tip --template '{date|isodate}\n' | grep '1970' | 90 $ hg tip --template '{date|isodate}\n' | grep '1970' |
91 [1] | |
78 $ cd .. | 92 $ cd .. |
79 | 93 |
80 | 94 |
81 partial subdir commit test | 95 partial subdir commit test |
82 | 96 |
210 | 224 |
211 should fail because we are specifying a file name | 225 should fail because we are specifying a file name |
212 | 226 |
213 $ hg ci -mmerge a | 227 $ hg ci -mmerge a |
214 abort: cannot partially commit a merge (do not specify files or patterns) | 228 abort: cannot partially commit a merge (do not specify files or patterns) |
229 [255] | |
215 | 230 |
216 should fail because we are specifying a pattern | 231 should fail because we are specifying a pattern |
217 | 232 |
218 $ hg ci -mmerge -I a | 233 $ hg ci -mmerge -I a |
219 abort: cannot partially commit a merge (do not specify files or patterns) | 234 abort: cannot partially commit a merge (do not specify files or patterns) |
235 [255] | |
220 | 236 |
221 should succeed | 237 should succeed |
222 | 238 |
223 $ hg ci -mmerge | 239 $ hg ci -mmerge |
224 $ cd .. | 240 $ cd .. |
246 HG: branch 'default' | 262 HG: branch 'default' |
247 HG: added added | 263 HG: added added |
248 HG: changed changed | 264 HG: changed changed |
249 HG: removed removed | 265 HG: removed removed |
250 abort: empty commit message | 266 abort: empty commit message |
267 [255] | |
251 $ cd .. | 268 $ cd .. |
252 | 269 |
253 $ exit 0 | 270 $ exit 0 |