Mercurial > hg
annotate tests/test-convert-hg-sink @ 8564:6b9ec23b09fc
named branches: improve pre-push logic (issue736)
Each named branch is considered separately, and the push is allowed if
no new branch heads are created for any named branch to be pushed.
Due to some tests's use of --debug, their output will change after this
addition. This has been fixed as well.
Co-contributor: Henrik Stuart <henrik.stuart@edlund.dk>
author | Sune Foldager <cryo@cyanite.org> |
---|---|
date | Sat, 23 May 2009 17:04:31 +0200 |
parents | 6c82beaaa11a |
children | 68e0a55eee6e |
rev | line source |
---|---|
5278
70e9a527cc61
convert: avoid dirstate checks; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
1 #!/bin/sh |
70e9a527cc61
convert: avoid dirstate checks; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
2 |
5556
61fdf2558c0a
convert: some tidyups, doc improvements, and test fixes
Bryan O'Sullivan <bos@serpentine.com>
parents:
5279
diff
changeset
|
3 cat >> $HGRCPATH <<EOF |
61fdf2558c0a
convert: some tidyups, doc improvements, and test fixes
Bryan O'Sullivan <bos@serpentine.com>
parents:
5279
diff
changeset
|
4 [extensions] |
61fdf2558c0a
convert: some tidyups, doc improvements, and test fixes
Bryan O'Sullivan <bos@serpentine.com>
parents:
5279
diff
changeset
|
5 convert= |
61fdf2558c0a
convert: some tidyups, doc improvements, and test fixes
Bryan O'Sullivan <bos@serpentine.com>
parents:
5279
diff
changeset
|
6 [convert] |
61fdf2558c0a
convert: some tidyups, doc improvements, and test fixes
Bryan O'Sullivan <bos@serpentine.com>
parents:
5279
diff
changeset
|
7 hg.saverev=False |
61fdf2558c0a
convert: some tidyups, doc improvements, and test fixes
Bryan O'Sullivan <bos@serpentine.com>
parents:
5279
diff
changeset
|
8 EOF |
5278
70e9a527cc61
convert: avoid dirstate checks; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
9 |
70e9a527cc61
convert: avoid dirstate checks; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
10 hg init orig |
70e9a527cc61
convert: avoid dirstate checks; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
11 cd orig |
70e9a527cc61
convert: avoid dirstate checks; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
12 echo foo > foo |
70e9a527cc61
convert: avoid dirstate checks; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
13 echo bar > bar |
8167
6c82beaaa11a
tests: removed redundant "-d '0 0'" from test scripts
Martin Geisler <mg@lazybytes.net>
parents:
5556
diff
changeset
|
14 hg ci -qAm 'add foo and bar' |
5278
70e9a527cc61
convert: avoid dirstate checks; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
15 |
70e9a527cc61
convert: avoid dirstate checks; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
16 hg rm foo |
8167
6c82beaaa11a
tests: removed redundant "-d '0 0'" from test scripts
Martin Geisler <mg@lazybytes.net>
parents:
5556
diff
changeset
|
17 hg ci -m 'remove foo' |
5278
70e9a527cc61
convert: avoid dirstate checks; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
18 |
70e9a527cc61
convert: avoid dirstate checks; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
19 mkdir foo |
70e9a527cc61
convert: avoid dirstate checks; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
20 echo file > foo/file |
8167
6c82beaaa11a
tests: removed redundant "-d '0 0'" from test scripts
Martin Geisler <mg@lazybytes.net>
parents:
5556
diff
changeset
|
21 hg ci -qAm 'add foo/file' |
5278
70e9a527cc61
convert: avoid dirstate checks; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
22 |
8167
6c82beaaa11a
tests: removed redundant "-d '0 0'" from test scripts
Martin Geisler <mg@lazybytes.net>
parents:
5556
diff
changeset
|
23 hg tag some-tag |
5278
70e9a527cc61
convert: avoid dirstate checks; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
24 |
70e9a527cc61
convert: avoid dirstate checks; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
25 hg log |
70e9a527cc61
convert: avoid dirstate checks; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
26 cd .. |
70e9a527cc61
convert: avoid dirstate checks; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
27 |
70e9a527cc61
convert: avoid dirstate checks; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
28 hg convert orig new 2>&1 | grep -v 'subversion python bindings could not be loaded' |
70e9a527cc61
convert: avoid dirstate checks; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
29 cd new |
70e9a527cc61
convert: avoid dirstate checks; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
30 hg out ../orig |
5279
2dbd750b3ddd
convert: clear the dirstate before a conversion, invalidate it afterwards
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5278
diff
changeset
|
31 |
2dbd750b3ddd
convert: clear the dirstate before a conversion, invalidate it afterwards
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5278
diff
changeset
|
32 echo '% dirstate should be empty:' |
2dbd750b3ddd
convert: clear the dirstate before a conversion, invalidate it afterwards
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5278
diff
changeset
|
33 hg debugstate |
2dbd750b3ddd
convert: clear the dirstate before a conversion, invalidate it afterwards
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5278
diff
changeset
|
34 hg parents -q |
2dbd750b3ddd
convert: clear the dirstate before a conversion, invalidate it afterwards
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5278
diff
changeset
|
35 |
2dbd750b3ddd
convert: clear the dirstate before a conversion, invalidate it afterwards
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5278
diff
changeset
|
36 hg up -C |
2dbd750b3ddd
convert: clear the dirstate before a conversion, invalidate it afterwards
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5278
diff
changeset
|
37 hg copy bar baz |
2dbd750b3ddd
convert: clear the dirstate before a conversion, invalidate it afterwards
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5278
diff
changeset
|
38 echo '% put something in the dirstate:' |
2dbd750b3ddd
convert: clear the dirstate before a conversion, invalidate it afterwards
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5278
diff
changeset
|
39 hg debugstate > debugstate |
2dbd750b3ddd
convert: clear the dirstate before a conversion, invalidate it afterwards
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5278
diff
changeset
|
40 grep baz debugstate |
2dbd750b3ddd
convert: clear the dirstate before a conversion, invalidate it afterwards
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5278
diff
changeset
|
41 |
2dbd750b3ddd
convert: clear the dirstate before a conversion, invalidate it afterwards
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5278
diff
changeset
|
42 echo '% add a new revision in the original repo' |
2dbd750b3ddd
convert: clear the dirstate before a conversion, invalidate it afterwards
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5278
diff
changeset
|
43 cd ../orig |
2dbd750b3ddd
convert: clear the dirstate before a conversion, invalidate it afterwards
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5278
diff
changeset
|
44 echo baz > baz |
2dbd750b3ddd
convert: clear the dirstate before a conversion, invalidate it afterwards
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5278
diff
changeset
|
45 hg ci -qAm 'add baz' |
2dbd750b3ddd
convert: clear the dirstate before a conversion, invalidate it afterwards
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5278
diff
changeset
|
46 |
2dbd750b3ddd
convert: clear the dirstate before a conversion, invalidate it afterwards
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5278
diff
changeset
|
47 cd .. |
2dbd750b3ddd
convert: clear the dirstate before a conversion, invalidate it afterwards
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5278
diff
changeset
|
48 hg convert orig new 2>&1 | grep -v 'subversion python bindings could not be loaded' |
2dbd750b3ddd
convert: clear the dirstate before a conversion, invalidate it afterwards
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5278
diff
changeset
|
49 cd new |
2dbd750b3ddd
convert: clear the dirstate before a conversion, invalidate it afterwards
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5278
diff
changeset
|
50 hg out ../orig |
2dbd750b3ddd
convert: clear the dirstate before a conversion, invalidate it afterwards
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5278
diff
changeset
|
51 echo '% dirstate should be the same (no output below):' |
2dbd750b3ddd
convert: clear the dirstate before a conversion, invalidate it afterwards
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5278
diff
changeset
|
52 hg debugstate > new-debugstate |
2dbd750b3ddd
convert: clear the dirstate before a conversion, invalidate it afterwards
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5278
diff
changeset
|
53 diff debugstate new-debugstate |
2dbd750b3ddd
convert: clear the dirstate before a conversion, invalidate it afterwards
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5278
diff
changeset
|
54 |
2dbd750b3ddd
convert: clear the dirstate before a conversion, invalidate it afterwards
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5278
diff
changeset
|
55 echo '% no copies' |
2dbd750b3ddd
convert: clear the dirstate before a conversion, invalidate it afterwards
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5278
diff
changeset
|
56 hg up -C |
2dbd750b3ddd
convert: clear the dirstate before a conversion, invalidate it afterwards
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5278
diff
changeset
|
57 hg debugrename baz |