##// END OF EJS Templates
tests: unify test-children
Pradeepkumar Gayam -
r11920:d0a7e700 default
parent child Browse files
Show More
@@ -1,59 +1,123 b''
1 #!/bin/sh
1 test children command
2 # test children command
2
3 $ cat <<EOF >> $HGRCPATH
4 > [extensions]
5 > children =
6 > EOF
7
8 init
9 $ hg init t
10 $ cd t
11
12 no working directory
13 $ hg children
3
14
4 cat <<EOF >> $HGRCPATH
15 setup
5 [extensions]
16 $ echo 0 > file0
6 children =
17 $ hg ci -qAm 0 -d '0 0'
7 EOF
18
19 $ echo 1 > file1
20 $ hg ci -qAm 1 -d '1 0'
8
21
9 echo "% init"
22 $ echo 2 >> file0
10 hg init t
23 $ hg ci -qAm 2 -d '2 0'
11 cd t
24
25 $ hg co null
26 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
27 $ echo 3 > file3
28 $ hg ci -qAm 3 -d '3 0'
12
29
13 echo "% no working directory"
30 hg children at revision 3 (tip)
14 hg children
31 $ hg children
15
32
16 echo % setup
33 $ hg co null
17 echo 0 > file0
34 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
18 hg ci -qAm 0 -d '0 0'
19
35
20 echo 1 > file1
36 hg children at nullrev (should be 0 and 3)
21 hg ci -qAm 1 -d '1 0'
37 $ hg children
38 changeset: 0:4df8521a7374
39 user: test
40 date: Thu Jan 01 00:00:00 1970 +0000
41 summary: 0
42
43 changeset: 3:e2962852269d
44 tag: tip
45 parent: -1:000000000000
46 user: test
47 date: Thu Jan 01 00:00:03 1970 +0000
48 summary: 3
49
50 $ hg co 1
51 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
22
52
23 echo 2 >> file0
53 hg children at revision 1 (should be 2)
24 hg ci -qAm 2 -d '2 0'
54 $ hg children
25
55 changeset: 2:8f5eea5023c2
26 hg co null
56 user: test
27 echo 3 > file3
57 date: Thu Jan 01 00:00:02 1970 +0000
28 hg ci -qAm 3 -d '3 0'
58 summary: 2
59
60 $ hg co 2
61 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
29
62
30 echo "% hg children at revision 3 (tip)"
63 hg children at revision 2 (other head)
31 hg children
64 $ hg children
32
33 hg co null
34 echo "% hg children at nullrev (should be 0 and 3)"
35 hg children
36
37 hg co 1
38 echo "% hg children at revision 1 (should be 2)"
39 hg children
40
41 hg co 2
42 echo "% hg children at revision 2 (other head)"
43 hg children
44
65
45 for i in null 0 1 2 3; do
66 $ for i in null 0 1 2 3; do
46 echo "% hg children -r $i"
67 > echo "hg children -r $i"
47 hg children -r $i
68 > hg children -r $i
48 done
69 > done
49
70 hg children -r null
50 echo "% hg children -r 0 file0 (should be 2)"
71 changeset: 0:4df8521a7374
51 hg children -r 0 file0
72 user: test
73 date: Thu Jan 01 00:00:00 1970 +0000
74 summary: 0
75
76 changeset: 3:e2962852269d
77 tag: tip
78 parent: -1:000000000000
79 user: test
80 date: Thu Jan 01 00:00:03 1970 +0000
81 summary: 3
82
83 hg children -r 0
84 changeset: 1:708c093edef0
85 user: test
86 date: Thu Jan 01 00:00:01 1970 +0000
87 summary: 1
88
89 hg children -r 1
90 changeset: 2:8f5eea5023c2
91 user: test
92 date: Thu Jan 01 00:00:02 1970 +0000
93 summary: 2
94
95 hg children -r 2
96 hg children -r 3
52
97
53 echo "% hg children -r 1 file0 (should be 2)"
98 hg children -r 0 file0 (should be 2)
54 hg children -r 1 file0
99 $ hg children -r 0 file0
100 changeset: 2:8f5eea5023c2
101 user: test
102 date: Thu Jan 01 00:00:02 1970 +0000
103 summary: 2
104
55
105
56 hg co 0
106 hg children -r 1 file0 (should be 2)
57 echo "% hg children file0 at revision 0 (should be 2)"
107 $ hg children -r 1 file0
58 hg children file0
108 changeset: 2:8f5eea5023c2
109 user: test
110 date: Thu Jan 01 00:00:02 1970 +0000
111 summary: 2
112
59
113
114 $ hg co 0
115 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
116
117 hg children file0 at revision 0 (should be 2)
118 $ hg children file0
119 changeset: 2:8f5eea5023c2
120 user: test
121 date: Thu Jan 01 00:00:02 1970 +0000
122 summary: 2
123
1 NO CONTENT: file was removed
NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now