Mercurial > public > mercurial-scm > evolve
comparison docs/tutorials/tutorial.t @ 229:681e25e5d83a
[doc] update tutorial text.
author | Pierre-Yves David <pierre-yves.david@logilab.fr> |
---|---|
date | Wed, 09 May 2012 16:39:35 +0200 |
parents | 5a17c0d41a00 |
children | 5236927419bf |
comparison
equal
deleted
inserted
replaced
228:5a17c0d41a00 | 229:681e25e5d83a |
---|---|
1 =================================== | 1 |
2 Mutable History and collaboration | 2 Initial setup |
3 =================================== | |
4 | |
5 .. warning:: need heavy update | |
6 | |
7 Single Developer Usage | |
8 ====================== | |
9 | |
10 This tutorial shows how to use evolution to replace the basics of *mq*. | |
11 | |
12 Amending a changeset | |
13 --------------------- | 3 --------------------- |
14 | 4 .. Various setup |
15 First there is some setup phase you will understand later. | |
16 | |
17 There is a local repository and a remote one. | |
18 | 5 |
19 $ cat >> $HGRCPATH << EOF | 6 $ cat >> $HGRCPATH << EOF |
20 > [ui] | 7 > [ui] |
21 > logtemplate ="{node|short} ({phase}): {desc}\n" | 8 > logtemplate ="{node|short} ({phase}): {desc}\n" |
22 > [diff] | 9 > [diff] |
23 > git = 1 | 10 > git = 1 |
24 > [alias] | 11 > [alias] |
25 > amend = amend -d '0 0' | 12 > amend = amend -d '0 0' |
26 > [extensions] | 13 > [extensions] |
27 > hgext.graphlog= | 14 > hgext.graphlog= |
28 > hgext.rebase= | 15 > EOF |
29 > EOF | |
30 $ $(dirname $TESTDIR)/enable.sh >> $HGRCPATH 2> /dev/null | |
31 | 16 |
32 $ hg init local | 17 $ hg init local |
33 $ cat >> local/.hg/hgrc << EOF | 18 $ cat >> local/.hg/hgrc << EOF |
34 > [paths] | 19 > [paths] |
35 > remote = ../remote | 20 > remote = ../remote |
21 > other = ../other | |
36 > [ui] | 22 > [ui] |
37 > user = Babar the King | 23 > user = Babar the King |
38 > EOF | 24 > EOF |
39 | 25 |
40 $ hg init remote | 26 $ hg init remote |
43 > local = ../local | 29 > local = ../local |
44 > [ui] | 30 > [ui] |
45 > user = Celestine the Queen | 31 > user = Celestine the Queen |
46 > EOF | 32 > EOF |
47 | 33 |
34 $ hg init other | |
35 $ cat >> other/.hg/hgrc << EOF | |
36 > [ui] | |
37 > user = Princess Flore | |
38 > EOF | |
39 | |
40 | |
41 This tutorial use the following configuration for Mercurial: | |
42 | |
43 A compact log template with phase data: | |
44 | |
45 $ hg showconfig ui | |
46 ui.slash=True | |
47 ui.logtemplate="{node|short} ({phase}): {desc}\n" | |
48 | |
49 Improved git format diff: | |
50 | |
51 $ hg showconfig diff | |
52 diff.git=1 | |
53 | |
54 And the graphlog extension | |
55 $ hg showconfig extensions | |
56 extensions.hgext.graphlog= | |
57 | |
58 And of course, we anabled the experimental extensions for mutable history: | |
59 | |
60 $ $(dirname $TESTDIR)/enable.sh >> $HGRCPATH 2> /dev/null | |
61 | |
62 | |
63 ----------------------- | |
64 Single Developer Usage | |
65 ----------------------- | |
66 | |
67 This tutorial shows how to use evolution to rewrite history locally. | |
68 | |
69 | |
70 Fixing mistake with `hg amend` | |
71 -------------------------------- | |
72 | |
73 We are versionning a shopping list | |
74 | |
48 $ cd local | 75 $ cd local |
49 | |
50 You can reopen you eyes. | |
51 | |
52 Now we make a first version of our shopping list. | |
53 | |
54 $ cat >> shopping << EOF | 76 $ cat >> shopping << EOF |
55 > Spam | 77 > Spam |
56 > Whizzo butter | 78 > Whizzo butter |
57 > Albatross | 79 > Albatross |
58 > Rat (rather a lot) | 80 > Rat (rather a lot) |
61 > Salmon mousse | 83 > Salmon mousse |
62 > EOF | 84 > EOF |
63 $ hg commit -A -m "Monthy Python Shopping list" | 85 $ hg commit -A -m "Monthy Python Shopping list" |
64 adding shopping | 86 adding shopping |
65 | 87 |
66 We share this first version with the outside. | 88 Its first version is shared with the outside. |
67 | 89 |
68 $ hg push remote | 90 $ hg push remote |
69 pushing to $TESTTMP/remote | 91 pushing to $TESTTMP/remote |
70 searching for changes | 92 searching for changes |
71 adding changesets | 93 adding changesets |
87 > Pear | 109 > Pear |
88 > Apple | 110 > Apple |
89 > EOF | 111 > EOF |
90 $ hg commit -m "adding fruit" | 112 $ hg commit -m "adding fruit" |
91 | 113 |
92 I now have the following history: | 114 This history is very linear |
93 | 115 |
94 $ hg log | 116 $ hg glog |
95 d85de4546133 (draft): adding fruit | 117 @ d85de4546133 (draft): adding fruit |
96 4d5dc8187023 (draft): adding condiment | 118 | |
97 7e82d3f3c2cb (public): Monthy Python Shopping list | 119 o 4d5dc8187023 (draft): adding condiment |
98 | 120 | |
99 But, I just notice, I made a typo in Banana. | 121 o 7e82d3f3c2cb (public): Monthy Python Shopping list |
122 | |
123 | |
124 But a typo was made in Babanas! | |
100 | 125 |
101 $ hg export tip | 126 $ hg export tip |
102 # HG changeset patch | 127 # HG changeset patch |
103 # User test | 128 # User test |
104 # Date 0 0 | 129 # Date 0 0 |
115 Oil | 140 Oil |
116 +Bananos | 141 +Bananos |
117 +Pear | 142 +Pear |
118 +Apple | 143 +Apple |
119 | 144 |
120 The faulty changeset is in the "draft" phase because he was not exchanged with the outside. The first one have been exchanged and is an immutable public changeset | 145 The faulty changeset is in the "draft" phase because he was not exchanged with |
121 | 146 the outside. The first one have been exchanged and is an immutable public |
122 $ hg log | 147 changeset. |
123 d85de4546133 (draft): adding fruit | 148 |
124 4d5dc8187023 (draft): adding condiment | 149 $ hg glog |
125 7e82d3f3c2cb (public): Monthy Python Shopping list | 150 @ d85de4546133 (draft): adding fruit |
151 | | |
152 o 4d5dc8187023 (draft): adding condiment | |
153 | | |
154 o 7e82d3f3c2cb (public): Monthy Python Shopping list | |
155 | |
126 | 156 |
127 hopefully. I can use hg amend to rewrite my faulty changeset! | 157 hopefully. I can use hg amend to rewrite my faulty changeset! |
128 | 158 |
129 $ sed -i'' -e s/Bananos/Banana/ shopping | 159 $ sed -i'' -e s/Bananos/Banana/ shopping |
130 $ hg diff | 160 $ hg diff |
141 Apple | 171 Apple |
142 $ hg amend | 172 $ hg amend |
143 | 173 |
144 A new changeset with the right diff replace the wrong one. | 174 A new changeset with the right diff replace the wrong one. |
145 | 175 |
146 $ hg log | 176 $ hg glog |
147 0cacb48f4482 (draft): adding fruit | 177 @ 0cacb48f4482 (draft): adding fruit |
148 4d5dc8187023 (draft): adding condiment | 178 | |
149 7e82d3f3c2cb (public): Monthy Python Shopping list | 179 o 4d5dc8187023 (draft): adding condiment |
180 | | |
181 o 7e82d3f3c2cb (public): Monthy Python Shopping list | |
182 | |
150 $ hg export tip | 183 $ hg export tip |
151 # HG changeset patch | 184 # HG changeset patch |
152 # User test | 185 # User test |
153 # Date 0 0 | 186 # Date 0 0 |
154 # Node ID 0cacb48f44828d2fd31c4e45e18fde32a5b2f07b | 187 # Node ID 0cacb48f44828d2fd31c4e45e18fde32a5b2f07b |
169 Getting Ride of branchy history | 202 Getting Ride of branchy history |
170 ---------------------------------- | 203 ---------------------------------- |
171 | 204 |
172 While I was working on my list. someone help made a change remotly. | 205 While I was working on my list. someone help made a change remotly. |
173 | 206 |
174 close your eyes | |
175 | |
176 $ cd ../remote | 207 $ cd ../remote |
177 $ hg up -q | 208 $ hg up -q |
178 $ sed -i'' -e 's/Spam/Spam Spam Spam/' shopping | 209 $ sed -i'' -e 's/Spam/Spam Spam Spam/' shopping |
179 $ hg ci -m 'SPAM' | 210 $ hg ci -m 'SPAM' |
180 $ cd ../local | 211 $ cd ../local |
181 | 212 |
182 open your eyes | 213 I'll get this remote changeset when pulling |
183 | 214 |
184 $ hg pull remote | 215 $ hg pull remote |
185 pulling from $TESTTMP/remote | 216 pulling from $TESTTMP/remote |
186 searching for changes | 217 searching for changes |
187 adding changesets | 218 adding changesets |
188 adding manifests | 219 adding manifests |
189 adding file changes | 220 adding file changes |
190 added 1 changesets with 1 changes to 1 files (+1 heads) | 221 added 1 changesets with 1 changes to 1 files (+1 heads) |
191 (run 'hg heads .' to see heads, 'hg merge' to merge) | 222 (run 'hg heads .' to see heads, 'hg merge' to merge) |
192 | 223 |
193 I now have a new heads. Note that the remote head is immutable | 224 I now have a new heads. Note that this remote head is immutable |
194 | 225 |
195 $ hg log | |
196 9ca060c80d74 (public): SPAM | |
197 0cacb48f4482 (draft): adding fruit | |
198 4d5dc8187023 (draft): adding condiment | |
199 7e82d3f3c2cb (public): Monthy Python Shopping list | |
200 $ hg log -G | 226 $ hg log -G |
201 o 9ca060c80d74 (public): SPAM | 227 o 9ca060c80d74 (public): SPAM |
202 | | 228 | |
203 | @ 0cacb48f4482 (draft): adding fruit | 229 | @ 0cacb48f4482 (draft): adding fruit |
204 | | | 230 | | |
215 merging shopping | 241 merging shopping |
216 | 242 |
217 | 243 |
218 My local work is now rebased on the remote one. | 244 My local work is now rebased on the remote one. |
219 | 245 |
220 $ hg log | |
221 387187ad9bd9 (draft): adding fruit | |
222 dfd3a2d7691e (draft): adding condiment | |
223 9ca060c80d74 (public): SPAM | |
224 7e82d3f3c2cb (public): Monthy Python Shopping list | |
225 $ hg log -G | 246 $ hg log -G |
226 @ 387187ad9bd9 (draft): adding fruit | 247 @ 387187ad9bd9 (draft): adding fruit |
227 | | 248 | |
228 o dfd3a2d7691e (draft): adding condiment | 249 o dfd3a2d7691e (draft): adding condiment |
229 | | 250 | |
242 > bus | 263 > bus |
243 > plane | 264 > plane |
244 > boat | 265 > boat |
245 > EOF | 266 > EOF |
246 $ hg ci -m 'transport' | 267 $ hg ci -m 'transport' |
247 $ hg log | 268 $ hg log -G |
248 d58c77aa15d7 (draft): transport | 269 @ d58c77aa15d7 (draft): transport |
249 387187ad9bd9 (draft): adding fruit | 270 | |
250 dfd3a2d7691e (draft): adding condiment | 271 o 387187ad9bd9 (draft): adding fruit |
251 9ca060c80d74 (public): SPAM | 272 | |
252 7e82d3f3c2cb (public): Monthy Python Shopping list | 273 o dfd3a2d7691e (draft): adding condiment |
274 | | |
275 o 9ca060c80d74 (public): SPAM | |
276 | | |
277 o 7e82d3f3c2cb (public): Monthy Python Shopping list | |
278 | |
253 | 279 |
254 I have a new commit but I realize that don't want it. (transport shop list does | 280 I have a new commit but I realize that don't want it. (transport shop list does |
255 not fit well in my standard shopping list) | 281 not fit well in my standard shopping list) |
256 | 282 |
257 $ hg kill . # . is for working directory parent. | 283 $ hg kill . # . is for working directory parent |
258 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | 284 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
259 working directory now at 387187ad9bd9 | 285 working directory now at 387187ad9bd9 |
260 | 286 |
261 The silly changeset is gone. | 287 The silly changeset is gone. |
262 | 288 |
263 $ hg log | 289 $ hg log -G |
264 387187ad9bd9 (draft): adding fruit | 290 @ 387187ad9bd9 (draft): adding fruit |
265 dfd3a2d7691e (draft): adding condiment | 291 | |
266 9ca060c80d74 (public): SPAM | 292 o dfd3a2d7691e (draft): adding condiment |
267 7e82d3f3c2cb (public): Monthy Python Shopping list | 293 | |
294 o 9ca060c80d74 (public): SPAM | |
295 | | |
296 o 7e82d3f3c2cb (public): Monthy Python Shopping list | |
297 | |
268 | 298 |
269 Reordering changeset | 299 Reordering changeset |
270 ------------------------ | 300 ------------------------ |
271 | 301 |
272 | 302 |
273 We create two changeset. | 303 We create two changesets. |
274 | 304 |
275 | 305 |
276 $ cat >> shopping << EOF | 306 $ cat >> shopping << EOF |
277 > Shampoo | 307 > Shampoo |
278 > Toothbrush | 308 > Toothbrush |
282 > EOF | 312 > EOF |
283 $ hg ci -m 'bathroom stuff' -q # XXX remove the -q | 313 $ hg ci -m 'bathroom stuff' -q # XXX remove the -q |
284 | 314 |
285 $ sed -i'' -e 's/Spam/Spam Spam Spam/g' shopping | 315 $ sed -i'' -e 's/Spam/Spam Spam Spam/g' shopping |
286 $ hg ci -m 'SPAM SPAM' | 316 $ hg ci -m 'SPAM SPAM' |
287 $ hg log | 317 $ hg log -G |
288 c48f32fb1787 (draft): SPAM SPAM | 318 @ c48f32fb1787 (draft): SPAM SPAM |
289 8d39a843582d (draft): bathroom stuff | 319 | |
290 387187ad9bd9 (draft): adding fruit | 320 o 8d39a843582d (draft): bathroom stuff |
291 dfd3a2d7691e (draft): adding condiment | 321 | |
292 9ca060c80d74 (public): SPAM | 322 o 387187ad9bd9 (draft): adding fruit |
293 7e82d3f3c2cb (public): Monthy Python Shopping list | 323 | |
324 o dfd3a2d7691e (draft): adding condiment | |
325 | | |
326 o 9ca060c80d74 (public): SPAM | |
327 | | |
328 o 7e82d3f3c2cb (public): Monthy Python Shopping list | |
329 | |
294 | 330 |
295 .. note: don't amend changeset 7e82d3f3c2cb or 9ca060c80d74 as they are | 331 .. note: don't amend changeset 7e82d3f3c2cb or 9ca060c80d74 as they are |
296 immutable. | 332 immutable. |
297 | 333 |
298 I now want to push to remote all my change but the bathroom one that i'm not totally happy with yet. | 334 I now want to push to remote all my change but the bathroom one that i'm not |
299 | 335 totally happy with yet. To be able to push "SPAM SPAM" I need a version of "SPAM SPAM" not children of |
300 To be able to push "SPAM SPAM" I need a version of "SPAM SPAM" not children of "bathroom stuff" | 336 "bathroom stuff" |
301 | 337 |
302 You can use 'rebase -r' or 'graft -O' for that: | 338 You can use 'rebase -r' or 'graft -O' for that: |
303 | 339 |
304 $ hg up 'p1(8d39a843582d)' # going on "bathroom stuff" parent | 340 $ hg up 'p1(8d39a843582d)' # going on "bathroom stuff" parent |
305 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | 341 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
320 o 7e82d3f3c2cb (public): Monthy Python Shopping list | 356 o 7e82d3f3c2cb (public): Monthy Python Shopping list |
321 | 357 |
322 | 358 |
323 We have a new SPAM SPAM version without the bathroom stuff | 359 We have a new SPAM SPAM version without the bathroom stuff |
324 | 360 |
325 $ grep Spam shopping # enouth spamm | 361 $ grep Spam shopping # enouth spam |
326 Spam Spam Spam Spam Spam Spam Spam Spam Spam | 362 Spam Spam Spam Spam Spam Spam Spam Spam Spam |
327 $ grep Toothbrush shopping # no Toothbrush | 363 $ grep Toothbrush shopping # no Toothbrush |
328 [1] | 364 [1] |
329 $ hg export . | 365 $ hg export . |
330 # HG changeset patch | 366 # HG changeset patch |
362 for simplicity shake we get the bathroom change in line again | 398 for simplicity shake we get the bathroom change in line again |
363 | 399 |
364 $ hg rebase -Dr 8d39a843582d -d a2fccc2e7b08 | 400 $ hg rebase -Dr 8d39a843582d -d a2fccc2e7b08 |
365 merging shopping | 401 merging shopping |
366 $ hg phase --draft . | 402 $ hg phase --draft . |
403 $ hg log -G | |
404 @ 8a79ae8b029e (draft): bathroom stuff | |
405 | | |
406 o a2fccc2e7b08 (public): SPAM SPAM | |
407 | | |
408 o 387187ad9bd9 (public): adding fruit | |
409 | | |
410 o dfd3a2d7691e (public): adding condiment | |
411 | | |
412 o 9ca060c80d74 (public): SPAM | |
413 | | |
414 o 7e82d3f3c2cb (public): Monthy Python Shopping list | |
415 | |
416 | |
367 | 417 |
368 | 418 |
369 Splitting change | 419 Splitting change |
370 ------------------ | 420 ------------------ |
371 | 421 |
374 Collapsing change | 424 Collapsing change |
375 ------------------ | 425 ------------------ |
376 | 426 |
377 To be done (currently achieve with "revert + debugobsolete" or "rebase --collapse") | 427 To be done (currently achieve with "revert + debugobsolete" or "rebase --collapse") |
378 | 428 |
379 collaboration | 429 |
380 ==================== | 430 |
431 | |
432 | |
433 | |
434 ----------------------- | |
435 Collaboration | |
436 ----------------------- | |
381 | 437 |
382 | 438 |
383 sharing mutable changeset | 439 sharing mutable changeset |
384 ---------------------------- | 440 ---------------------------- |
385 | 441 |
388 behavior where exchanged changeset are automatically published. | 444 behavior where exchanged changeset are automatically published. |
389 | 445 |
390 $ cd ../remote | 446 $ cd ../remote |
391 $ hg -R ../local/ showconfig phases | 447 $ hg -R ../local/ showconfig phases |
392 | 448 |
393 the localrepo does not have any specific configuration for `phases.publish`. It is ``true`` by default. | 449 the localrepo does not have any specific configuration for `phases.publish`. It |
450 is ``true`` by default. | |
394 | 451 |
395 $ hg pull local | 452 $ hg pull local |
396 pulling from $TESTTMP/local | 453 pulling from $TESTTMP/local |
397 searching for changes | 454 searching for changes |
398 adding changesets | 455 adding changesets |
399 adding manifests | 456 adding manifests |
400 adding file changes | 457 adding file changes |
401 added 1 changesets with 1 changes to 1 files | 458 added 1 changesets with 1 changes to 1 files |
402 (run 'hg update' to get a working copy) | 459 (run 'hg update' to get a working copy) |
403 $ hg log | 460 $ hg log -G |
404 8a79ae8b029e (public): bathroom stuff | 461 o 8a79ae8b029e (public): bathroom stuff |
405 a2fccc2e7b08 (public): SPAM SPAM | 462 | |
406 387187ad9bd9 (public): adding fruit | 463 o a2fccc2e7b08 (public): SPAM SPAM |
407 dfd3a2d7691e (public): adding condiment | 464 | |
408 9ca060c80d74 (public): SPAM | 465 o 387187ad9bd9 (public): adding fruit |
409 7e82d3f3c2cb (public): Monthy Python Shopping list | 466 | |
467 o dfd3a2d7691e (public): adding condiment | |
468 | | |
469 @ 9ca060c80d74 (public): SPAM | |
470 | | |
471 o 7e82d3f3c2cb (public): Monthy Python Shopping list | |
472 | |
410 | 473 |
411 | 474 |
412 | 475 |
413 We do not want to publish the "bathroom changeset". Let's rollback the last transaction | 476 We do not want to publish the "bathroom changeset". Let's rollback the last transaction |
414 | 477 |
415 $ hg rollback | 478 $ hg rollback |
416 repository tip rolled back to revision 4 (undo pull) | 479 repository tip rolled back to revision 4 (undo pull) |
417 $ hg log | 480 $ hg log -G |
418 a2fccc2e7b08 (public): SPAM SPAM | 481 o a2fccc2e7b08 (public): SPAM SPAM |
419 387187ad9bd9 (public): adding fruit | 482 | |
420 dfd3a2d7691e (public): adding condiment | 483 o 387187ad9bd9 (public): adding fruit |
421 9ca060c80d74 (public): SPAM | 484 | |
422 7e82d3f3c2cb (public): Monthy Python Shopping list | 485 o dfd3a2d7691e (public): adding condiment |
423 | 486 | |
424 Let's make thz local repo "non publishing" | 487 @ 9ca060c80d74 (public): SPAM |
488 | | |
489 o 7e82d3f3c2cb (public): Monthy Python Shopping list | |
490 | |
491 | |
492 Let's make the local repo "non publishing" | |
425 | 493 |
426 $ echo "[phases]\npublish=false" >> ../local/.hg/hgrc | 494 $ echo "[phases]\npublish=false" >> ../local/.hg/hgrc |
427 $ echo "[phases]\npublish=false" >> .hg/hgrc | 495 $ echo "[phases]\npublish=false" >> .hg/hgrc |
428 $ hg showconfig phases | 496 $ hg showconfig phases |
429 phases.publish=false | 497 phases.publish=false |
439 adding changesets | 507 adding changesets |
440 adding manifests | 508 adding manifests |
441 adding file changes | 509 adding file changes |
442 added 1 changesets with 1 changes to 1 files | 510 added 1 changesets with 1 changes to 1 files |
443 (run 'hg update' to get a working copy) | 511 (run 'hg update' to get a working copy) |
444 $ hg log | 512 $ hg log -G |
445 8a79ae8b029e (draft): bathroom stuff | 513 o 8a79ae8b029e (draft): bathroom stuff |
446 a2fccc2e7b08 (public): SPAM SPAM | 514 | |
447 387187ad9bd9 (public): adding fruit | 515 o a2fccc2e7b08 (public): SPAM SPAM |
448 dfd3a2d7691e (public): adding condiment | 516 | |
449 9ca060c80d74 (public): SPAM | 517 o 387187ad9bd9 (public): adding fruit |
450 7e82d3f3c2cb (public): Monthy Python Shopping list | 518 | |
519 o dfd3a2d7691e (public): adding condiment | |
520 | | |
521 @ 9ca060c80d74 (public): SPAM | |
522 | | |
523 o 7e82d3f3c2cb (public): Monthy Python Shopping list | |
524 | |
451 | 525 |
452 Rebasing unstable change after pull | 526 Rebasing unstable change after pull |
453 ---------------------------------------------- | 527 ---------------------------------------------- |
454 | 528 |
455 Remotely someone add a new changeset on top of our mutable "bathroom" on. | 529 Remotely someone add a new changeset on top of the mutable "bathroom" on. |
456 | 530 |
457 $ hg up 8a79ae8b029e -q | 531 $ hg up 8a79ae8b029e -q |
458 $ cat >> shopping << EOF | 532 $ cat >> shopping << EOF |
459 > Giraffe | 533 > Giraffe |
460 > Rhino | 534 > Rhino |
461 > Lion | 535 > Lion |
462 > Bear | 536 > Bear |
463 > EOF | 537 > EOF |
464 $ hg ci -m 'animals' -q # XXX remove the -q | 538 $ hg ci -m 'animals' |
465 | 539 |
466 While this time locally, we updated "bathroom changeset" | 540 But at the same time, locally, this same "bathroom changeset" was updated. |
467 | 541 |
468 $ cd ../local | 542 $ cd ../local |
469 $ hg up 8a79ae8b029e -q | 543 $ hg up 8a79ae8b029e -q |
470 $ sed -i'' -e 's/... More bathroom stuff to come/Bath Robe/' shopping | 544 $ sed -i'' -e 's/... More bathroom stuff to come/Bath Robe/' shopping |
471 $ hg amend | 545 $ hg amend |
472 $ hg log | 546 $ hg log -G |
473 ffa278c50818 (draft): bathroom stuff | 547 @ ffa278c50818 (draft): bathroom stuff |
474 a2fccc2e7b08 (public): SPAM SPAM | 548 | |
475 387187ad9bd9 (public): adding fruit | 549 o a2fccc2e7b08 (public): SPAM SPAM |
476 dfd3a2d7691e (public): adding condiment | 550 | |
477 9ca060c80d74 (public): SPAM | 551 o 387187ad9bd9 (public): adding fruit |
478 7e82d3f3c2cb (public): Monthy Python Shopping list | 552 | |
553 o dfd3a2d7691e (public): adding condiment | |
554 | | |
555 o 9ca060c80d74 (public): SPAM | |
556 | | |
557 o 7e82d3f3c2cb (public): Monthy Python Shopping list | |
558 | |
479 | 559 |
480 | 560 |
481 When we pull from remote again we get an unstable state! | 561 When we pull from remote again we get an unstable state! |
482 | 562 |
483 | 563 |
488 adding manifests | 568 adding manifests |
489 adding file changes | 569 adding file changes |
490 added 1 changesets with 1 changes to 1 files (+1 heads) | 570 added 1 changesets with 1 changes to 1 files (+1 heads) |
491 (run 'hg heads .' to see heads, 'hg merge' to merge) | 571 (run 'hg heads .' to see heads, 'hg merge' to merge) |
492 1 new unstables changesets | 572 1 new unstables changesets |
493 $ hg log -r 'extinct()' | |
494 $ hg log | |
495 9ac5d0e790a2 (draft): animals | |
496 ffa278c50818 (draft): bathroom stuff | |
497 8a79ae8b029e (draft): bathroom stuff | |
498 a2fccc2e7b08 (public): SPAM SPAM | |
499 387187ad9bd9 (public): adding fruit | |
500 dfd3a2d7691e (public): adding condiment | |
501 9ca060c80d74 (public): SPAM | |
502 7e82d3f3c2cb (public): Monthy Python Shopping list | |
503 | 573 |
504 | 574 |
505 The new changeset "animal" is based one an old changeset of "bathroom". You can | 575 The new changeset "animal" is based one an old changeset of "bathroom". You can |
506 see both version showing up the log. | 576 see both version showing up in the log. |
507 | 577 |
508 $ hg glog | 578 $ hg log -G |
509 o 9ac5d0e790a2 (draft): animals | 579 o 9ac5d0e790a2 (draft): animals |
510 | | 580 | |
511 | @ ffa278c50818 (draft): bathroom stuff | 581 | @ ffa278c50818 (draft): bathroom stuff |
512 | | | 582 | | |
513 o | 8a79ae8b029e (draft): bathroom stuff | 583 o | 8a79ae8b029e (draft): bathroom stuff |
521 o 9ca060c80d74 (public): SPAM | 591 o 9ca060c80d74 (public): SPAM |
522 | | 592 | |
523 o 7e82d3f3c2cb (public): Monthy Python Shopping list | 593 o 7e82d3f3c2cb (public): Monthy Python Shopping list |
524 | 594 |
525 | 595 |
526 In hgview there is a nice doted relation highlighting ffa278c50818 is a new | 596 The older version 8a79ae8b029e never ceased to exist in the local repo. It was |
527 version of 8a79ae8b029e. this is not yet ported to graphlog. | 597 jsut hidden and excluded from pull and push. |
598 | |
599 .. note:: In hgview there is a nice doted relation highlighting ffa278c50818 as a new version of 8a79ae8b029e. this is not yet ported to graphlog. | |
600 | |
601 Their is **unstable** changeset in this history now. Mercurial will refuse to | |
602 share it with the outside: | |
603 | |
604 $ hg push other | |
605 pushing to $TESTTMP/other | |
606 searching for changes | |
607 abort: Trying to push unstable changeset: 9ac5d0e790a2! | |
608 (use 'hg stabilize' to get a stable history (or --force to proceed)) | |
609 [255] | |
610 | |
611 | |
612 | |
528 | 613 |
529 To resolve this unstable state, you need to rebase 9ac5d0e790a2 onto | 614 To resolve this unstable state, you need to rebase 9ac5d0e790a2 onto |
530 ffa278c50818 the "hg stabilize" command will make this for you. It has a | 615 ffa278c50818 the "hg stabilize" command will make this for you. |
531 --dry-run option to only suggest the next move | 616 |
617 It has a --dry-run option to only suggest the next move. | |
532 | 618 |
533 $ hg stabilize --dry-run | 619 $ hg stabilize --dry-run |
534 move:[15] animals | 620 move:[15] animals |
535 atop:[14] bathroom stuff | 621 atop:[14] bathroom stuff |
536 hg rebase -Dr 9ac5d0e790a2 -d ffa278c50818 | 622 hg rebase -Dr 9ac5d0e790a2 -d ffa278c50818 |
537 | 623 |
538 | |
539 Let's do it | 624 Let's do it |
540 | 625 |
541 $ hg rebase -Dr 9ac5d0e790a2 -d ffa278c50818 | 626 $ hg rebase -Dr 9ac5d0e790a2 -d ffa278c50818 |
542 merging shopping | 627 merging shopping |
543 | 628 |
544 The old version of bathroom is hidden again now. | 629 The old version of bathroom is hidden again. |
545 | 630 |
546 $ hg log | 631 $ hg log -G |
547 437efbcaf700 (draft): animals | 632 @ 437efbcaf700 (draft): animals |
548 ffa278c50818 (draft): bathroom stuff | 633 | |
549 a2fccc2e7b08 (public): SPAM SPAM | 634 o ffa278c50818 (draft): bathroom stuff |
550 387187ad9bd9 (public): adding fruit | 635 | |
551 dfd3a2d7691e (public): adding condiment | 636 o a2fccc2e7b08 (public): SPAM SPAM |
552 9ca060c80d74 (public): SPAM | 637 | |
553 7e82d3f3c2cb (public): Monthy Python Shopping list | 638 o 387187ad9bd9 (public): adding fruit |
639 | | |
640 o dfd3a2d7691e (public): adding condiment | |
641 | | |
642 o 9ca060c80d74 (public): SPAM | |
643 | | |
644 o 7e82d3f3c2cb (public): Monthy Python Shopping list | |
645 | |
554 | 646 |
555 | 647 |
556 We can push this evolution to remote | 648 We can push this evolution to remote |
557 | 649 |
558 $ hg push -f remote # XXX should not require -f | 650 $ hg push remote |
559 pushing to $TESTTMP/remote | 651 pushing to $TESTTMP/remote |
560 searching for changes | 652 searching for changes |
561 adding changesets | 653 adding changesets |
562 adding manifests | 654 adding manifests |
563 adding file changes | 655 adding file changes |
564 added 2 changesets with 2 changes to 1 files (+1 heads) | 656 added 2 changesets with 2 changes to 1 files (+1 heads) |
565 | 657 |
566 remote get a warning that current working directory is based on an obsolete changeset | 658 remote get a warning that current working directory is based on an obsolete changeset |
567 | 659 |
568 $ cd ../remote | 660 $ cd ../remote |
569 $ hg up . # XXX "loulz" | 661 $ hg pull local # we up again to trigger the warning. it was displayed during the push |
570 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | 662 pulling from $TESTTMP/local |
663 searching for changes | |
664 no changes found | |
571 Working directory parent is obsolete | 665 Working directory parent is obsolete |
572 | 666 |
573 $ hg up 437efbcaf700 | 667 $ hg up 437efbcaf700 |
574 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | 668 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
575 | 669 |
579 The remote guy keep working | 673 The remote guy keep working |
580 | 674 |
581 $ sed -i'' -e 's/Spam/Spam Spam Spam Spam/g' shopping | 675 $ sed -i'' -e 's/Spam/Spam Spam Spam Spam/g' shopping |
582 $ hg commit -m "SPAM SPAM SPAM" | 676 $ hg commit -m "SPAM SPAM SPAM" |
583 | 677 |
584 Work I can keep getting localy | 678 I'm pulling its work locally. |
585 | 679 |
586 $ cd ../local | 680 $ cd ../local |
587 $ hg pull remote | 681 $ hg pull remote |
588 pulling from $TESTTMP/remote | 682 pulling from $TESTTMP/remote |
589 searching for changes | 683 searching for changes |
590 adding changesets | 684 adding changesets |
591 adding manifests | 685 adding manifests |
592 adding file changes | 686 adding file changes |
593 added 1 changesets with 1 changes to 1 files | 687 added 1 changesets with 1 changes to 1 files |
594 (run 'hg update' to get a working copy) | 688 (run 'hg update' to get a working copy) |
595 $ hg log | 689 $ hg log -G |
596 ae45c0c3092a (draft): SPAM SPAM SPAM | 690 o ae45c0c3092a (draft): SPAM SPAM SPAM |
597 437efbcaf700 (draft): animals | 691 | |
598 ffa278c50818 (draft): bathroom stuff | 692 @ 437efbcaf700 (draft): animals |
599 a2fccc2e7b08 (public): SPAM SPAM | 693 | |
600 387187ad9bd9 (public): adding fruit | 694 o ffa278c50818 (draft): bathroom stuff |
601 dfd3a2d7691e (public): adding condiment | 695 | |
602 9ca060c80d74 (public): SPAM | 696 o a2fccc2e7b08 (public): SPAM SPAM |
603 7e82d3f3c2cb (public): Monthy Python Shopping list | 697 | |
698 o 387187ad9bd9 (public): adding fruit | |
699 | | |
700 o dfd3a2d7691e (public): adding condiment | |
701 | | |
702 o 9ca060c80d74 (public): SPAM | |
703 | | |
704 o 7e82d3f3c2cb (public): Monthy Python Shopping list | |
705 | |
604 | 706 |
605 In the mean time I noticed you can't buy animals in a super market and I kill the animal changeset: | 707 In the mean time I noticed you can't buy animals in a super market and I kill the animal changeset: |
606 | 708 |
607 $ hg kill 437efbcaf700 | 709 $ hg kill 437efbcaf700 |
608 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | 710 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
611 | 713 |
612 | 714 |
613 The animals changeset is still displayed because the "SPAM SPAM SPAM" changeset | 715 The animals changeset is still displayed because the "SPAM SPAM SPAM" changeset |
614 is neither dead or obsolete. My repository is in an unstable state again. | 716 is neither dead or obsolete. My repository is in an unstable state again. |
615 | 717 |
616 $ hg log | 718 $ hg log -G |
617 ae45c0c3092a (draft): SPAM SPAM SPAM | 719 o ae45c0c3092a (draft): SPAM SPAM SPAM |
618 437efbcaf700 (draft): animals | 720 | |
619 ffa278c50818 (draft): bathroom stuff | 721 o 437efbcaf700 (draft): animals |
620 a2fccc2e7b08 (public): SPAM SPAM | 722 | |
621 387187ad9bd9 (public): adding fruit | 723 @ ffa278c50818 (draft): bathroom stuff |
622 dfd3a2d7691e (public): adding condiment | 724 | |
623 9ca060c80d74 (public): SPAM | 725 o a2fccc2e7b08 (public): SPAM SPAM |
624 7e82d3f3c2cb (public): Monthy Python Shopping list | 726 | |
727 o 387187ad9bd9 (public): adding fruit | |
728 | | |
729 o dfd3a2d7691e (public): adding condiment | |
730 | | |
731 o 9ca060c80d74 (public): SPAM | |
732 | | |
733 o 7e82d3f3c2cb (public): Monthy Python Shopping list | |
734 | |
625 | 735 |
626 $ hg log -r 'unstable()' | 736 $ hg log -r 'unstable()' |
627 ae45c0c3092a (draft): SPAM SPAM SPAM | 737 ae45c0c3092a (draft): SPAM SPAM SPAM |
628 | 738 |
629 $ hg log -G | 739 # XXX make kill stabilization works |
630 o ae45c0c3092a (draft): SPAM SPAM SPAM | |
631 | | |
632 o 437efbcaf700 (draft): animals | |
633 | | |
634 @ ffa278c50818 (draft): bathroom stuff | |
635 | | |
636 o a2fccc2e7b08 (public): SPAM SPAM | |
637 | | |
638 o 387187ad9bd9 (public): adding fruit | |
639 | | |
640 o dfd3a2d7691e (public): adding condiment | |
641 | | |
642 o 9ca060c80d74 (public): SPAM | |
643 | | |
644 o 7e82d3f3c2cb (public): Monthy Python Shopping list | |
645 | |
646 # XXX make this work | |
647 # $ hg stabilize --any | 740 # $ hg stabilize --any |
648 # merging shopping | 741 # merging shopping |
649 | 742 |
650 $ hg graft -O ae45c0c3092a | 743 $ hg graft -O ae45c0c3092a |
651 grafting revision 17 | 744 grafting revision 17 |
652 merging shopping | 745 merging shopping |
653 | 746 |
654 $ hg log | 747 $ hg log -G |
655 20de1fb1cec5 (draft): SPAM SPAM SPAM | 748 @ 20de1fb1cec5 (draft): SPAM SPAM SPAM |
656 ffa278c50818 (draft): bathroom stuff | 749 | |
657 a2fccc2e7b08 (public): SPAM SPAM | 750 o ffa278c50818 (draft): bathroom stuff |
658 387187ad9bd9 (public): adding fruit | 751 | |
659 dfd3a2d7691e (public): adding condiment | 752 o a2fccc2e7b08 (public): SPAM SPAM |
660 9ca060c80d74 (public): SPAM | 753 | |
661 7e82d3f3c2cb (public): Monthy Python Shopping list | 754 o 387187ad9bd9 (public): adding fruit |
755 | | |
756 o dfd3a2d7691e (public): adding condiment | |
757 | | |
758 o 9ca060c80d74 (public): SPAM | |
759 | | |
760 o 7e82d3f3c2cb (public): Monthy Python Shopping list | |
761 | |
662 | 762 |
663 | 763 |
664 Handling Conflicting amend | 764 Handling Conflicting amend |
665 ---------------------------------------------- | 765 ---------------------------------------------- |
666 | 766 |
667 We can detect that multiple diverging//conflicting amend have been made. There | 767 We can detect that multiple diverging//conflicting amend have been made. There |
668 will be a "evol-merge" command to merge conflicting amend | 768 will be a "evol-merge" command to merge conflicting amend |
769 | |
770 This command is not ready yet. |