Mercurial > hg
annotate tests/test-commit @ 5839:59fba5caa94b
Don't use the -i option with sed
This patch fixes test-keyword on platforms without GNU sed (like
OpenBSD).
author | Will Maier <willmaier@ml1.net> |
---|---|
date | Wed, 09 Jan 2008 10:00:18 -0600 |
parents | 75c2071385da |
children | 81e20e01d465 |
rev | line source |
---|---|
1196
3738e85ead07
Make date/timezone validation in changelog.add more robust. Add test.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
1 #!/bin/sh |
3738e85ead07
Make date/timezone validation in changelog.add more robust. Add test.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
2 |
3786
8d603f8567ae
make hg commit <dirname> work again
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3709
diff
changeset
|
3 cleanpath() |
8d603f8567ae
make hg commit <dirname> work again
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3709
diff
changeset
|
4 { |
8d603f8567ae
make hg commit <dirname> work again
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3709
diff
changeset
|
5 sed -e "s:/.*\(/test/.*\):...\1:" |
8d603f8567ae
make hg commit <dirname> work again
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3709
diff
changeset
|
6 } |
8d603f8567ae
make hg commit <dirname> work again
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3709
diff
changeset
|
7 |
3709
38291d9c8c1c
Expand test-commit to cover one of the recent bugs.
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
1933
diff
changeset
|
8 echo % commit date test |
1196
3738e85ead07
Make date/timezone validation in changelog.add more robust. Add test.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
9 hg init test |
3738e85ead07
Make date/timezone validation in changelog.add more robust. Add test.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
10 cd test |
3738e85ead07
Make date/timezone validation in changelog.add more robust. Add test.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
11 echo foo > foo |
3738e85ead07
Make date/timezone validation in changelog.add more robust. Add test.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
12 hg add foo |
5754
75c2071385da
Prompt for a commit message in editor, improve error message
Patrick Mezard <pmezard@gmail.com>
parents:
4253
diff
changeset
|
13 HGEDITOR=true hg commit -m "" |
1196
3738e85ead07
Make date/timezone validation in changelog.add more robust. Add test.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
14 hg commit -d '0 0' -m commit-1 |
3738e85ead07
Make date/timezone validation in changelog.add more robust. Add test.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
15 echo foo >> foo |
3738e85ead07
Make date/timezone validation in changelog.add more robust. Add test.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
16 hg commit -d '1 4444444' -m commit-3 |
3738e85ead07
Make date/timezone validation in changelog.add more robust. Add test.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
17 hg commit -d '1 15.1' -m commit-4 |
3738e85ead07
Make date/timezone validation in changelog.add more robust. Add test.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
18 hg commit -d 'foo bar' -m commit-5 |
3738e85ead07
Make date/timezone validation in changelog.add more robust. Add test.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
19 hg commit -d ' 1 4444' -m commit-6 |
3738e85ead07
Make date/timezone validation in changelog.add more robust. Add test.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
20 hg commit -d '111111111111 0' -m commit-7 |
1488
08c7851969cc
only files in normal state should be marked as deleted
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
1203
diff
changeset
|
21 |
3709
38291d9c8c1c
Expand test-commit to cover one of the recent bugs.
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
1933
diff
changeset
|
22 echo % partial commit test |
1488
08c7851969cc
only files in normal state should be marked as deleted
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
1203
diff
changeset
|
23 echo bar > bar |
08c7851969cc
only files in normal state should be marked as deleted
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
1203
diff
changeset
|
24 hg add bar |
08c7851969cc
only files in normal state should be marked as deleted
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
1203
diff
changeset
|
25 rm bar |
3786
8d603f8567ae
make hg commit <dirname> work again
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3709
diff
changeset
|
26 hg commit -d "1000000 0" -m commit-8 2>&1 | cleanpath |
8d603f8567ae
make hg commit <dirname> work again
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3709
diff
changeset
|
27 |
8d603f8567ae
make hg commit <dirname> work again
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3709
diff
changeset
|
28 hg -q revert -a --no-backup |
8d603f8567ae
make hg commit <dirname> work again
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3709
diff
changeset
|
29 |
8d603f8567ae
make hg commit <dirname> work again
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3709
diff
changeset
|
30 mkdir dir |
8d603f8567ae
make hg commit <dirname> work again
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3709
diff
changeset
|
31 echo boo > dir/file |
8d603f8567ae
make hg commit <dirname> work again
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3709
diff
changeset
|
32 hg add |
8d603f8567ae
make hg commit <dirname> work again
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3709
diff
changeset
|
33 hg -v commit -d '0 0' -m commit-9 dir |
8d603f8567ae
make hg commit <dirname> work again
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3709
diff
changeset
|
34 |
8d603f8567ae
make hg commit <dirname> work again
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3709
diff
changeset
|
35 echo > dir.file |
8d603f8567ae
make hg commit <dirname> work again
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3709
diff
changeset
|
36 hg add |
8d603f8567ae
make hg commit <dirname> work again
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3709
diff
changeset
|
37 hg commit -d '0 0' -m commit-10 dir dir.file 2>&1 | cleanpath |
8d603f8567ae
make hg commit <dirname> work again
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3709
diff
changeset
|
38 |
8d603f8567ae
make hg commit <dirname> work again
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3709
diff
changeset
|
39 echo >> dir/file |
8d603f8567ae
make hg commit <dirname> work again
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3709
diff
changeset
|
40 mkdir bleh |
8d603f8567ae
make hg commit <dirname> work again
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3709
diff
changeset
|
41 mkdir dir2 |
8d603f8567ae
make hg commit <dirname> work again
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3709
diff
changeset
|
42 cd bleh |
8d603f8567ae
make hg commit <dirname> work again
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3709
diff
changeset
|
43 hg commit -d '0 0' -m commit-11 . 2>&1 | cleanpath |
8d603f8567ae
make hg commit <dirname> work again
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3709
diff
changeset
|
44 hg commit -d '0 0' -m commit-12 ../dir ../dir2 2>&1 | cleanpath |
8d603f8567ae
make hg commit <dirname> work again
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3709
diff
changeset
|
45 hg -v commit -d '0 0' -m commit-13 ../dir |
8d603f8567ae
make hg commit <dirname> work again
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3709
diff
changeset
|
46 cd .. |
8d603f8567ae
make hg commit <dirname> work again
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3709
diff
changeset
|
47 |
8d603f8567ae
make hg commit <dirname> work again
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3709
diff
changeset
|
48 hg commit -d '0 0' -m commit-14 does-not-exist 2>&1 | cleanpath |
8d603f8567ae
make hg commit <dirname> work again
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3709
diff
changeset
|
49 ln -s foo baz |
8d603f8567ae
make hg commit <dirname> work again
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3709
diff
changeset
|
50 hg commit -d '0 0' -m commit-15 baz 2>&1 | cleanpath |
8d603f8567ae
make hg commit <dirname> work again
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3709
diff
changeset
|
51 touch quux |
8d603f8567ae
make hg commit <dirname> work again
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3709
diff
changeset
|
52 hg commit -d '0 0' -m commit-16 quux 2>&1 | cleanpath |
8d603f8567ae
make hg commit <dirname> work again
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3709
diff
changeset
|
53 echo >> dir/file |
8d603f8567ae
make hg commit <dirname> work again
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3709
diff
changeset
|
54 hg -v commit -d '0 0' -m commit-17 dir/file |
3709
38291d9c8c1c
Expand test-commit to cover one of the recent bugs.
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
1933
diff
changeset
|
55 cd .. |
38291d9c8c1c
Expand test-commit to cover one of the recent bugs.
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
1933
diff
changeset
|
56 |
38291d9c8c1c
Expand test-commit to cover one of the recent bugs.
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
1933
diff
changeset
|
57 echo % partial subdir commit test |
38291d9c8c1c
Expand test-commit to cover one of the recent bugs.
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
1933
diff
changeset
|
58 hg init test2 |
38291d9c8c1c
Expand test-commit to cover one of the recent bugs.
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
1933
diff
changeset
|
59 cd test2 |
38291d9c8c1c
Expand test-commit to cover one of the recent bugs.
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
1933
diff
changeset
|
60 mkdir foo |
38291d9c8c1c
Expand test-commit to cover one of the recent bugs.
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
1933
diff
changeset
|
61 echo foo > foo/foo |
38291d9c8c1c
Expand test-commit to cover one of the recent bugs.
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
1933
diff
changeset
|
62 mkdir bar |
38291d9c8c1c
Expand test-commit to cover one of the recent bugs.
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
1933
diff
changeset
|
63 echo bar > bar/bar |
38291d9c8c1c
Expand test-commit to cover one of the recent bugs.
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
1933
diff
changeset
|
64 hg add |
38291d9c8c1c
Expand test-commit to cover one of the recent bugs.
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
1933
diff
changeset
|
65 hg ci -d '1000000 0' -u test -m commit-subdir-1 foo |
38291d9c8c1c
Expand test-commit to cover one of the recent bugs.
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
1933
diff
changeset
|
66 hg ci -d '1000001 0' -u test -m commit-subdir-2 bar |
38291d9c8c1c
Expand test-commit to cover one of the recent bugs.
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
1933
diff
changeset
|
67 echo % subdir log 1 |
38291d9c8c1c
Expand test-commit to cover one of the recent bugs.
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
1933
diff
changeset
|
68 hg log -v foo |
38291d9c8c1c
Expand test-commit to cover one of the recent bugs.
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
1933
diff
changeset
|
69 echo % subdir log 2 |
38291d9c8c1c
Expand test-commit to cover one of the recent bugs.
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
1933
diff
changeset
|
70 hg log -v bar |
38291d9c8c1c
Expand test-commit to cover one of the recent bugs.
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
1933
diff
changeset
|
71 echo % full log |
38291d9c8c1c
Expand test-commit to cover one of the recent bugs.
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
1933
diff
changeset
|
72 hg log -v |
38291d9c8c1c
Expand test-commit to cover one of the recent bugs.
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
1933
diff
changeset
|
73 cd .. |
38291d9c8c1c
Expand test-commit to cover one of the recent bugs.
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
1933
diff
changeset
|
74 |
4253
9e3e975258a9
tests: expand test-commit a bit to test 'hg commit .' too
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
3786
diff
changeset
|
75 echo % dot and subdir commit test |
9e3e975258a9
tests: expand test-commit a bit to test 'hg commit .' too
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
3786
diff
changeset
|
76 hg init test3 |
9e3e975258a9
tests: expand test-commit a bit to test 'hg commit .' too
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
3786
diff
changeset
|
77 cd test3 |
9e3e975258a9
tests: expand test-commit a bit to test 'hg commit .' too
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
3786
diff
changeset
|
78 mkdir foo |
9e3e975258a9
tests: expand test-commit a bit to test 'hg commit .' too
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
3786
diff
changeset
|
79 echo foo content > foo/plain-file |
9e3e975258a9
tests: expand test-commit a bit to test 'hg commit .' too
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
3786
diff
changeset
|
80 hg add foo/plain-file |
9e3e975258a9
tests: expand test-commit a bit to test 'hg commit .' too
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
3786
diff
changeset
|
81 hg ci -d '1000000 0' -u test -m commit-foo-subdir foo |
9e3e975258a9
tests: expand test-commit a bit to test 'hg commit .' too
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
3786
diff
changeset
|
82 echo modified foo content > foo/plain-file |
9e3e975258a9
tests: expand test-commit a bit to test 'hg commit .' too
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
3786
diff
changeset
|
83 hg ci -d '2000000 0' -u test -m commit-foo-dot . |
9e3e975258a9
tests: expand test-commit a bit to test 'hg commit .' too
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
3786
diff
changeset
|
84 echo % full log |
9e3e975258a9
tests: expand test-commit a bit to test 'hg commit .' too
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
3786
diff
changeset
|
85 hg log -v |
9e3e975258a9
tests: expand test-commit a bit to test 'hg commit .' too
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
3786
diff
changeset
|
86 echo % subdir log |
9e3e975258a9
tests: expand test-commit a bit to test 'hg commit .' too
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
3786
diff
changeset
|
87 cd foo |
9e3e975258a9
tests: expand test-commit a bit to test 'hg commit .' too
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
3786
diff
changeset
|
88 hg log . |
9e3e975258a9
tests: expand test-commit a bit to test 'hg commit .' too
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
3786
diff
changeset
|
89 cd .. |
9e3e975258a9
tests: expand test-commit a bit to test 'hg commit .' too
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
3786
diff
changeset
|
90 cd .. |
9e3e975258a9
tests: expand test-commit a bit to test 'hg commit .' too
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
3786
diff
changeset
|
91 |
1203
cb4c423cbb38
Get test-commit to exit cleanly.
Bryan O'Sullivan <bos@serpentine.com>
parents:
1196
diff
changeset
|
92 exit 0 |