##// 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
32
33 $ hg co null
34 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
15
35
16 echo % setup
36 hg children at nullrev (should be 0 and 3)
17 echo 0 > file0
37 $ hg children
18 hg ci -qAm 0 -d '0 0'
38 changeset: 0:4df8521a7374
39 user: test
40 date: Thu Jan 01 00:00:00 1970 +0000
41 summary: 0
19
42
20 echo 1 > file1
43 changeset: 3:e2962852269d
21 hg ci -qAm 1 -d '1 0'
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
55 changeset: 2:8f5eea5023c2
56 user: test
57 date: Thu Jan 01 00:00:02 1970 +0000
58 summary: 2
25
59
26 hg co null
60 $ hg co 2
27 echo 3 > file3
61 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
28 hg ci -qAm 3 -d '3 0'
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
65
33 hg co null
66 $ for i in null 0 1 2 3; do
34 echo "% hg children at nullrev (should be 0 and 3)"
67 > echo "hg children -r $i"
35 hg children
68 > hg children -r $i
69 > done
70 hg children -r null
71 changeset: 0:4df8521a7374
72 user: test
73 date: Thu Jan 01 00:00:00 1970 +0000
74 summary: 0
36
75
37 hg co 1
76 changeset: 3:e2962852269d
38 echo "% hg children at revision 1 (should be 2)"
77 tag: tip
39 hg children
78 parent: -1:000000000000
79 user: test
80 date: Thu Jan 01 00:00:03 1970 +0000
81 summary: 3
40
82
41 hg co 2
83 hg children -r 0
42 echo "% hg children at revision 2 (other head)"
84 changeset: 1:708c093edef0
43 hg children
85 user: test
86 date: Thu Jan 01 00:00:01 1970 +0000
87 summary: 1
44
88
45 for i in null 0 1 2 3; do
89 hg children -r 1
46 echo "% hg children -r $i"
90 changeset: 2:8f5eea5023c2
47 hg children -r $i
91 user: test
48 done
92 date: Thu Jan 01 00:00:02 1970 +0000
93 summary: 2
49
94
50 echo "% hg children -r 0 file0 (should be 2)"
95 hg children -r 2
51 hg children -r 0 file0
96 hg children -r 3
97
98 hg children -r 0 file0 (should be 2)
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
52
105
53 echo "% hg children -r 1 file0 (should be 2)"
106 hg children -r 1 file0 (should be 2)
54 hg children -r 1 file0
107 $ hg children -r 1 file0
108 changeset: 2:8f5eea5023c2
109 user: test
110 date: Thu Jan 01 00:00:02 1970 +0000
111 summary: 2
112
55
113
56 hg co 0
114 $ hg co 0
57 echo "% hg children file0 at revision 0 (should be 2)"
115 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
58 hg children file0
59
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