comparison tests/test-topic.t @ 1839:1bc5e62fc0c7

Initial dumb version of topics.
author Augie Fackler <augie@google.com>
date Wed, 20 May 2015 21:23:28 -0400
parents
children 0ba067a97d06
comparison
equal deleted inserted replaced
-1:000000000000 1839:1bc5e62fc0c7
1 $ . "$TESTDIR/testlib"
2
3 $ hg init pinky
4 $ cd pinky
5 $ cat <<EOF >> .hg/hgrc
6 > [phases]
7 > publish=false
8 > EOF
9
10 $ hg help topics
11 hg topics
12
13 View current topic, set current topic, or see all topics.
14
15 options:
16
17 --clear clear active topic if any
18
19 (some details hidden, use --verbose to show complete help)
20 $ hg topics
21
22 $ for x in alpha beta gamma delta ; do
23 > echo file $x >> $x
24 > hg addremove
25 > hg ci -m "Add file $x"
26 > done
27 adding alpha
28 adding beta
29 adding gamma
30 adding delta
31
32 Still no topics
33 $ hg topics
34
35 Make a topic
36 $ hg topic narf
37 $ hg topics
38 * narf
39 $ echo topic work >> alpha
40 $ hg ci -m 'start on narf'
41 $ hg co .^
42 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
43 $ hg topic fran
44 $ hg topics
45 * fran
46 narf
47 $ echo >> fran work >> beta
48 $ hg ci -m 'start on fran'
49 created new head
50 $ hg co narf
51 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
52 $ hg topic
53 fran
54 * narf
55 $ echo 'narf!!!' >> alpha
56 $ hg ci -m 'narf!'
57 $ hg log -G
58 @ changeset: 6:7c34953036d6
59 | tag: tip
60 | topic: narf
61 | parent: 4:fb147b0b417c
62 | user: test
63 | date: Thu Jan 01 00:00:00 1970 +0000
64 | summary: narf!
65 |
66 | o changeset: 5:0469d521db49
67 | | topic: fran
68 | | parent: 3:a53952faf762
69 | | user: test
70 | | date: Thu Jan 01 00:00:00 1970 +0000
71 | | summary: start on fran
72 | |
73 o | changeset: 4:fb147b0b417c
74 |/ topic: narf
75 | user: test
76 | date: Thu Jan 01 00:00:00 1970 +0000
77 | summary: start on narf
78 |
79 o changeset: 3:a53952faf762
80 | user: test
81 | date: Thu Jan 01 00:00:00 1970 +0000
82 | summary: Add file delta
83 |
84 o changeset: 2:15d1eb11d2fa
85 | user: test
86 | date: Thu Jan 01 00:00:00 1970 +0000
87 | summary: Add file gamma
88 |
89 o changeset: 1:c692ea2c9224
90 | user: test
91 | date: Thu Jan 01 00:00:00 1970 +0000
92 | summary: Add file beta
93 |
94 o changeset: 0:c2b7d2f7d14b
95 user: test
96 date: Thu Jan 01 00:00:00 1970 +0000
97 summary: Add file alpha
98
99
100 Exchanging of topics:
101 $ cd ..
102 $ hg init brain
103 $ hg -R pinky push -r 4 brain
104 pushing to brain
105 searching for changes
106 adding changesets
107 adding manifests
108 adding file changes
109 added 5 changesets with 5 changes to 4 files
110 Now that we've pushed to brain, the work done on narf is no longer a
111 draft, so we won't see that topic name anymore:
112
113 $ hg log -R pinky -G
114 @ changeset: 6:7c34953036d6
115 | tag: tip
116 | topic: narf
117 | parent: 4:fb147b0b417c
118 | user: test
119 | date: Thu Jan 01 00:00:00 1970 +0000
120 | summary: narf!
121 |
122 | o changeset: 5:0469d521db49
123 | | topic: fran
124 | | parent: 3:a53952faf762
125 | | user: test
126 | | date: Thu Jan 01 00:00:00 1970 +0000
127 | | summary: start on fran
128 | |
129 o | changeset: 4:fb147b0b417c
130 |/ user: test
131 | date: Thu Jan 01 00:00:00 1970 +0000
132 | summary: start on narf
133 |
134 o changeset: 3:a53952faf762
135 | user: test
136 | date: Thu Jan 01 00:00:00 1970 +0000
137 | summary: Add file delta
138 |
139 o changeset: 2:15d1eb11d2fa
140 | user: test
141 | date: Thu Jan 01 00:00:00 1970 +0000
142 | summary: Add file gamma
143 |
144 o changeset: 1:c692ea2c9224
145 | user: test
146 | date: Thu Jan 01 00:00:00 1970 +0000
147 | summary: Add file beta
148 |
149 o changeset: 0:c2b7d2f7d14b
150 user: test
151 date: Thu Jan 01 00:00:00 1970 +0000
152 summary: Add file alpha
153
154 $ cd brain
155 $ hg co tip
156 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
157
158 Because the change is public, we won't inherit the topic from narf.
159
160 $ hg topic
161 $ echo what >> alpha
162 $ hg topic query
163 $ hg ci -m 'what is narf, pinky?'
164 $ hg log -Gl2
165 @ changeset: 5:c01515cfc331
166 | tag: tip
167 | topic: query
168 | user: test
169 | date: Thu Jan 01 00:00:00 1970 +0000
170 | summary: what is narf, pinky?
171 |
172 o changeset: 4:fb147b0b417c
173 | user: test
174 | date: Thu Jan 01 00:00:00 1970 +0000
175 | summary: start on narf
176 |
177 $ hg push -f ../pinky -r query
178 pushing to ../pinky
179 searching for changes
180 adding changesets
181 adding manifests
182 adding file changes
183 added 1 changesets with 1 changes to 1 files (+1 heads)
184 $ hg -R ../pinky log -Gl 4
185 o changeset: 7:c01515cfc331
186 | tag: tip
187 | topic: query
188 | parent: 4:fb147b0b417c
189 | user: test
190 | date: Thu Jan 01 00:00:00 1970 +0000
191 | summary: what is narf, pinky?
192 |
193 | @ changeset: 6:7c34953036d6
194 |/ topic: narf
195 | parent: 4:fb147b0b417c
196 | user: test
197 | date: Thu Jan 01 00:00:00 1970 +0000
198 | summary: narf!
199 |
200 | o changeset: 5:0469d521db49
201 | | topic: fran
202 | | parent: 3:a53952faf762
203 | | user: test
204 | | date: Thu Jan 01 00:00:00 1970 +0000
205 | | summary: start on fran
206 | |
207 o | changeset: 4:fb147b0b417c
208 |/ user: test
209 | date: Thu Jan 01 00:00:00 1970 +0000
210 | summary: start on narf
211 |
212 $ hg topics
213 * query
214 $ cd ../pinky
215 $ hg co query
216 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
217 $ echo answer >> alpha
218 $ hg ci -m 'Narf is like `zort` or `poit`!'
219 $ hg merge narf
220 merging alpha
221 warning: conflicts during merge.
222 merging alpha incomplete! (edit conflicts, then use 'hg resolve --mark')
223 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
224 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
225 [1]
226 $ hg revert -r narf alpha
227 $ hg resolve -m alpha
228 (no more unresolved files)
229 $ hg topic narf
230 $ hg ci -m 'Finish narf'
231 $ hg topics
232 fran
233 * narf
234 query
235 $ hg phase --public narf
236
237 POSSIBLE BUG: narf topic stays alive even though we just made all
238 narf commits public:
239
240 $ hg topics
241 fran
242 * narf
243 $ hg log -Gl 6
244 @ changeset: 9:ae074045b7a7
245 |\ tag: tip
246 | | parent: 8:54c943c1c167
247 | | parent: 6:7c34953036d6
248 | | user: test
249 | | date: Thu Jan 01 00:00:00 1970 +0000
250 | | summary: Finish narf
251 | |
252 | o changeset: 8:54c943c1c167
253 | | user: test
254 | | date: Thu Jan 01 00:00:00 1970 +0000
255 | | summary: Narf is like `zort` or `poit`!
256 | |
257 | o changeset: 7:c01515cfc331
258 | | parent: 4:fb147b0b417c
259 | | user: test
260 | | date: Thu Jan 01 00:00:00 1970 +0000
261 | | summary: what is narf, pinky?
262 | |
263 o | changeset: 6:7c34953036d6
264 |/ parent: 4:fb147b0b417c
265 | user: test
266 | date: Thu Jan 01 00:00:00 1970 +0000
267 | summary: narf!
268 |
269 | o changeset: 5:0469d521db49
270 | | topic: fran
271 | | parent: 3:a53952faf762
272 | | user: test
273 | | date: Thu Jan 01 00:00:00 1970 +0000
274 | | summary: start on fran
275 | |
276 o | changeset: 4:fb147b0b417c
277 |/ user: test
278 | date: Thu Jan 01 00:00:00 1970 +0000
279 | summary: start on narf
280 |
281 $ cd ../brain
282 $ hg topics
283 * query
284 $ hg pull ../pinky -r narf
285 pulling from ../pinky
286 abort: unknown revision 'narf'!
287 [255]
288 $ hg pull ../pinky -r default
289 pulling from ../pinky
290 searching for changes
291 adding changesets
292 adding manifests
293 adding file changes
294 added 3 changesets with 3 changes to 1 files
295 (run 'hg update' to get a working copy)
296 $ hg topics
297 * query
298
299 We can pull in the draft-phase change and we get the new topic
300
301 $ hg pull ../pinky
302 pulling from ../pinky
303 searching for changes
304 adding changesets
305 adding manifests
306 adding file changes
307 added 1 changesets with 1 changes to 1 files (+1 heads)
308 (run 'hg heads' to see heads, 'hg merge' to merge)
309 $ hg topics
310 fran
311 * query
312 $ hg log -Gr 'draft()'
313 o changeset: 9:0469d521db49
314 | tag: tip
315 | topic: fran
316 | parent: 3:a53952faf762
317 | user: test
318 | date: Thu Jan 01 00:00:00 1970 +0000
319 | summary: start on fran
320 |
321
322 query is not an open topic, so when we clear the current topic it'll
323 disappear:
324
325 $ hg topics --clear
326 $ hg topics
327 fran
328
329 --clear when we don't have an active topic isn't an error:
330
331 $ hg topics --clear
332
333 Move to fran, note that the topic activates, then deactivate the topic.
334
335 $ hg co fran
336 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
337 $ hg topics
338 * fran
339 $ hg topics --clear
340 $ echo fran? >> beta
341 $ hg ci -m 'fran?'
342 $ hg log -Gr 'draft()'
343 @ changeset: 10:4073470c35e1
344 | tag: tip
345 | user: test
346 | date: Thu Jan 01 00:00:00 1970 +0000
347 | summary: fran?
348 |
349 o changeset: 9:0469d521db49
350 | topic: fran
351 | parent: 3:a53952faf762
352 | user: test
353 | date: Thu Jan 01 00:00:00 1970 +0000
354 | summary: start on fran
355 |
356 $ hg topics
357 fran