comparison tests/basic.t @ 38:f371747bb8fc

Improving basic tests
author Marcin Kasperski <Marcin.Kasperski@mekk.waw.pl>
date Sat, 24 Sep 2016 16:07:50 +0200
parents cf3fe04cd96b
children aa0032c0ada8
comparison
equal deleted inserted replaced
37:cf3fe04cd96b 38:f371747bb8fc
19 19
20 $ cat > $HGRCPATH/basic.rc << EOF 20 $ cat > $HGRCPATH/basic.rc << EOF
21 > [ui] 21 > [ui]
22 > username = Andy Default <default@nowhere.net> 22 > username = Andy Default <default@nowhere.net>
23 > [extensions] 23 > [extensions]
24 > all_paths = 24 > mercurial_all_paths =
25 > EOF 25 > EOF
26 26
27 We need some repositories to test. 27 We need some repositories to test.
28 28
29 $ hg init "$BASE" 29 $ hg init "$BASE"
30 $ hg init "$REP1" 30 $ hg init "$REP1"
31 $ hg init "$REP2" 31 $ hg init "$REP2"
32 $ hg init "$REP3" 32 $ hg init "$REP3"
33 33
34 $ cat > $BASE/.hg/hgrc 34 $ cat > $BASE/.hg/hgrc << EOF
35 > [paths] 35 > [paths]
36 > remote1=$REP1 36 > remote1=$REP1
37 > remote2=$REP2 37 > remote2=$REP2
38 > remote3=$REP3 38 > remote3=$REP3
39 > EOF 39 > EOF
40 40
41 Let's test pushing 41 Let's test pushing
42 42
43 $ echo > $BASE/file.txt 43 $ cat > $BASE/file.txt << EOF
44 > Some text 44 > Some text
45 > EOF 45 > EOF
46 46
47 $ hg --cwd $BASE add 47 $ hg --cwd $BASE add
48 adding file.txt
48 $ hg --cwd $BASE commit -m 'First' 49 $ hg --cwd $BASE commit -m 'First'
49 50
50 $ hg --cwd $BASE pushall 51 $ hg --cwd $BASE pushal
51 52 pushing to */rep1 (glob)
52 $ hg --cwd $REP1 log 53 searching for changes
53 54 adding changesets
54 $ hg --cwd $REP2 log 55 adding manifests
55 56 adding file changes
56 $ hg --cwd $REP3 log 57 added 1 changesets with 1 changes to 1 files
58 pushing to */rep2 (glob)
59 searching for changes
60 adding changesets
61 adding manifests
62 adding file changes
63 added 1 changesets with 1 changes to 1 files
64 pushing to */rep3 (glob)
65 searching for changes
66 adding changesets
67 adding manifests
68 adding file changes
69 added 1 changesets with 1 changes to 1 files
70
71 $ hg --cwd $REP1 log -T '{rev}: {desc}\n'
72 0: First
73
74 $ hg --cwd $REP2 log -T '{rev}: {desc}\n'
75 0: First
76
77 $ hg --cwd $REP3 log -T '{rev}: {desc}\n'
78 0: First
57 79
58 Let's also test pulling 80 Let's also test pulling
59 81
60 $ hg --cwd $REP1 update 82 $ hg --cwd $REP1 update
61 83 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
62 $ echo > $REP1/rep1.txt 84
85 $ cat > $REP1/rep1.txt << EOF
63 > Another text 86 > Another text
64 > EOF 87 > EOF
65 88
66 $ hg --cwd $REP1 add 89 $ hg --cwd $REP1 add
90 adding rep1.txt
67 $ hg --cwd $REP1 commit -m "In repo1" 91 $ hg --cwd $REP1 commit -m "In repo1"
68 92
69 93
70 $ hg --cwd $REP2 update 94 $ hg --cwd $REP2 update
71 95 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
72 $ echo >> $REP2/file.txt 96
97 $ cat >> $REP2/file.txt << EOF
73 > From repo2… 98 > From repo2…
74 > EOF 99 > EOF
75 100
76 $ hg --cwd $REP2 add 101 $ hg --cwd $REP2 add
77 $ hg --cwd $REP2 commit -m "In repo2" 102 $ hg --cwd $REP2 commit -m "In repo2"
78 103
79 $ hg --cwd $BASE incomingall 104 $ hg --cwd $BASE incomingall
105 comparing with */rep1 (glob)
106 searching for changes
107 changeset: 1:* (glob)
108 tag: tip
109 user: Andy Default <default@nowhere.net>
110 date: .* (re)
111 summary: In repo1
112
113 comparing with */rep2 (glob)
114 searching for changes
115 changeset: 1:* (glob)
116 tag: tip
117 user: Andy Default <default@nowhere.net>
118 date: .* (re)
119 summary: In repo2
120
121 comparing with */rep3 (glob)
122 searching for changes
123 no changes found
80 124
81 $ hg --cwd $BASE pullall 125 $ hg --cwd $BASE pullall
82 126 pulling from */rep1 (glob)
83 $ hg --cwd $BASE log 127 searching for changes
128 adding changesets
129 adding manifests
130 adding file changes
131 added 1 changesets with 1 changes to 1 files
132 (run 'hg update' to get a working copy)
133 pulling from */rep2 (glob)
134 searching for changes
135 adding changesets
136 adding manifests
137 adding file changes
138 added 1 changesets with 1 changes to 1 files (+1 heads)
139 (run 'hg heads' to see heads, 'hg merge' to merge)
140 pulling from */rep3 (glob)
141 searching for changes
142 no changes found
143
144 $ hg --cwd $BASE log -T '{rev}: {desc}\n'
145 2: In repo2
146 1: In repo1
147 0: First
84 148
85 $ hg --cwd $BASE outgoingall 149 $ hg --cwd $BASE outgoingall
150 comparing with */rep1 (glob)
151 searching for changes
152 changeset: 2:af9f142e6a2b
153 tag: tip
154 parent: 0:3fd54094234f
155 user: Andy Default <default@nowhere.net>
156 date: Sat Sep 24 14:00:35 2016 +0000
157 summary: In repo2
158
159 comparing with */rep2 (glob)
160 searching for changes
161 changeset: 1:ad3792f1ee79
162 user: Andy Default <default@nowhere.net>
163 date: Sat Sep 24 14:00:35 2016 +0000
164 summary: In repo1
165
166 comparing with */rep3 (glob)
167 searching for changes
168 changeset: 1:ad3792f1ee79
169 user: Andy Default <default@nowhere.net>
170 date: Sat Sep 24 14:00:35 2016 +0000
171 summary: In repo1
172
173 changeset: 2:af9f142e6a2b
174 tag: tip
175 parent: 0:3fd54094234f
176 user: Andy Default <default@nowhere.net>
177 date: Sat Sep 24 14:00:35 2016 +0000
178 summary: In repo2
86 179
87 Without remotes those commands do nothing 180 Without remotes those commands do nothing
88 181
89 $ hg --cwd $REP3 pullall 182 $ hg --cwd $REP3 pullall
183 abort: No paths defined in section paths
184 [255]
90 185
91 $ hg --cwd $REP3 pushall 186 $ hg --cwd $REP3 pushall
187 abort: No paths defined in section paths
188 [255]
92 189
93 $ hg --cwd $REP3 incomingall 190 $ hg --cwd $REP3 incomingall
191 abort: No paths defined in section paths
192 [255]
94 193
95 $ hg --cwd $REP3 outgoingall 194 $ hg --cwd $REP3 outgoingall
195 abort: No paths defined in section paths
196 [255]
96 197
97 Finally let's test that push options work 198 Finally let's test that push options work
98 199
99 $ echo > $BASE/br1.txt 200 $ cat > $BASE/br1.txt << EOF
100 > Br1 text 201 > Br1 text
101 > EOF 202 > EOF
102 203
103 $ hg --cwd $BASE branch br1 204 $ hg --cwd $BASE branch br1
205 marked working directory as branch br1
206 (branches are permanent and global, did you want a bookmark?)
104 $ hg --cwd $BASE add 207 $ hg --cwd $BASE add
208 adding br1.txt
105 $ hg --cwd $BASE commit -m 'Br1' 209 $ hg --cwd $BASE commit -m 'Br1'
106 210
107 $ hg --cwd $BASE update default 211 $ hg --cwd $BASE update default
108 $ echo >> $BASE/file.txt 212 $ cat >> $BASE/file.txt << EOF
109 > later text 213 > later text
110 > EOF 214 > EOF
111 $ hg --cwd $BASE commit -m 'Normal'' 215 $ hg --cwd $BASE commit -m 'Normal'
112 216
113 $ hg --cwd $BASE pushall -r default -f 217 $ hg --cwd $BASE pushall -r default -f
114 218 pushing to */rep1 (glob)
115 $ hg --cwd $REP1 log 219 searching for changes
116 220 adding changesets
117 $ hg --cwd $REP2 log 221 adding manifests
118 222 adding file changes
119 $ hg --cwd $REP3 log 223 added 2 changesets with 2 changes to 1 files (+1 heads)
120 224 pushing to */rep2 (glob)
225 searching for changes
226 adding changesets
227 adding manifests
228 adding file changes
229 added 1 changesets with 1 changes to 1 files
230 pushing to */rep3 (glob)
231 searching for changes
232 adding changesets
233 adding manifests
234 adding file changes
235 added 2 changesets with 2 changes to 1 files
236
237 $ hg --cwd $BASE log -T '{rev}: {desc}\n'
238 4: Normal
239 3: Br1
240 2: In repo2
241 1: In repo1
242 0: First
243
244 $ hg --cwd $REP1 log -T '{rev}: {desc}\n'
245 3: Normal
246 2: In repo2
247 1: In repo1
248 0: First
249
250 $ hg --cwd $REP2 log -T '{rev}: {desc}\n'
251 2: Normal
252 1: In repo2
253 0: First
254
255 $ hg --cwd $REP3 log -T '{rev}: {desc}\n'
256 2: Normal
257 1: In repo2
258 0: First
259