1--- 2author: Boris Feld <boris.feld@octobus.net> 3title: Changeset evolution 4date: June 23, 2017 5--- 6 7# Why Evolve is the future? (TO CHANGE) 8 9Use hexagon or drop all of themes 10Use old names 11Replace hg amend by commit --amend 12 13Flow 14 15Basic - Feature - Tool / instability - command semantic 16 17Basic (local amend + local rebase) 18 19Stabilization -> Evolution 20 21Feature 22 23# Local amend 24 25## Amending commits 26 27We all makes mistake: 28 29~~~graphviz 30 digraph G { 31 rankdir="BT"; 32 graph[splines=polyline]; 33 node[fixedsize=true, width=1, height=1, style="filled", fillcolor="#7F7FFF"]; 34 35 // Revisions 36 node[group=main]; 37 Parent -> "Fx bug[case"; 38 } 39~~~ 40 41## Some times pass 42 43## Urgent Amend needed 44 45But it's easy to fix the fix: 46 47~~~ {.sh} 48hg commit --amend -m "Fix bug" 49~~~ 50 51~~~graphviz 52 digraph G { 53 rankdir="BT"; 54 graph[splines=polyline]; 55 node[fixedsize=true, width=1, height=1, style="filled", fillcolor="#7F7FFF"]; 56 57 // Revisions 58 node[group=main]; 59 Parent -> "Fix bug"; 60 } 61~~~ 62 63## So easy to do something wrong 64 65But wait you had local changes! And they get incorporated into the amend. 66 67## Too bad 68 69It's too late, they are gone! 70 71<img src="https://media1.giphy.com/media/vMiCDfoKdJP0c/giphy.gif"> 72 73## HARD 74 75UNbundle, get the rev, strip 76 77## Never without Evolve! 78 79<img src="https://media3.giphy.com/media/EVbEdEW3kuu0o/giphy.gif"> 80 81 82## Let's try again! 83 84~~~graphviz 85 digraph G { 86 rankdir="BT"; 87 graph[splines=polyline]; 88 node[fixedsize=true, width=1, height=1, style="filled", fillcolor="#7F7FFF"]; 89 90 // Revisions 91 node[group=main]; 92 Parent -> "Fx bug"; 93 } 94~~~ 95 96## Evolve powa 97 98With evolve this time: 99 100~~~ {.sh} 101hg commit --amend -m "Fix bug" 102~~~ 103 104~~~graphviz 105 digraph G { 106 rankdir="BT"; 107 graph[splines=polyline]; 108 node[fixedsize=true, width=1, height=1, style="filled", fillcolor="#7F7FFF"]; 109 110 // Revisions 111 node[group=main]; 112 Parent -> "Fix bug"; 113 } 114~~~ 115 116## Ok what the difference? 117 118<pre class="shell_output"> 119$> hg log -G 120@ <span style="color:olive;">changeset: 3:467de638a224</span> 121| tag: tip 122| parent: 0:852811e0e2a8 123| user: Boris Feld <boris.feld@octobus.net> 124| date: Wed Jun 21 14:15:55 2017 +0200 125| summary: Fix bug 126| 127o <span style="color:olive;">changeset: 0:852811e0e2a8</span> 128 user: Boris Feld <boris.feld@octobus.net> 129 date: Wed Jun 21 14:15:55 2017 +0200 130 summary: Root 131 132</pre> 133 134## The difference 135 136<pre class="shell_output"> 137$> hg log -G --hidden 138@ <span style="color:olive;">changeset: 3:467de638a224</span> 139| tag: tip 140| parent: 0:852811e0e2a8 141| user: Boris Feld <boris.feld@octobus.net> 142| date: Wed Jun 21 14:15:55 2017 +0200 143| summary: Fix bug 144| 145| x <span style="color:olive;">changeset: 2:614cb09cc83d</span> 146| | user: Boris Feld <boris.feld@octobus.net> 147| | date: Wed Jun 21 14:15:55 2017 +0200 148| | summary: temporary amend commit for e46245132d3d 149| | 150| x <span style="color:olive;">changeset: 1:e46245132d3d</span> 151|/ user: Boris Feld <boris.feld@octobus.net> 152| date: Wed Jun 21 14:15:55 2017 +0200 153| summary: Fx bug 154| 155o <span style="color:olive;">changeset: 0:852811e0e2a8</span> 156 user: Boris Feld <boris.feld@octobus.net> 157 date: Wed Jun 21 14:15:55 2017 +0200 158 summary: Root 159 160</pre> 161 162## Perf impact 163 164No strip == no cache bust, == faster 165 166# Local rebase 167 168## You are working on your branch 169 170~~~graphviz 171 digraph G { 172 rankdir="LR"; 173 graph[splines=polyline]; 174 node[fixedsize=true, width=1, height=1, style="filled", fillcolor="#7F7FFF"]; 175 176 // Revisions 177 node[group=feature]; 178 Parent -> "Feature"; 179 } 180~~~ 181 182## More work 183 184~~~graphviz 185 digraph G { 186 rankdir="LR"; 187 graph[splines=polyline]; 188 node[fixedsize=true, width=1, height=1, style="filled", fillcolor="#7F7FFF"]; 189 190 // Revisions 191 node[group=feature]; 192 Parent -> "Feature" -> "Feature 2"; 193 } 194~~~ 195 196## Pull 197 198~~~graphviz 199 digraph G { 200 rankdir="LR"; 201 graph[splines=polyline]; 202 node[fixedsize=true, width=1, height=1, style="filled", fillcolor="#7F7FFF"]; 203 204 // Revisions 205 node[group=main]; 206 Parent -> "Trunk" -> "Trunk 2"; 207 208 node[group=feature]; 209 Parent -> "Feature" -> "Feature 2"; 210 } 211~~~ 212 213## Time to rebase 214 215~~~graphviz 216 digraph G { 217 rankdir="LR"; 218 graph[splines=polyline]; 219 node[fixedsize=true, width=1, height=1, style="filled", fillcolor="#7F7FFF"]; 220 221 // Revisions 222 node[group=main]; 223 Parent -> "Trunk" -> "Trunk 2"; 224 225 node[group=feature]; 226 "Trunk 2" -> "Feature" -> "Feature 2"; 227 } 228~~~ 229 230## Without evolve 231 232<pre class="shell_output"> 233@ <span style="color:olive;">changeset: 6:105f743d81c8</span> 234| tag: tip 235| user: Boris Feld <boris.feld@octobus.net> 236| date: Wed Jun 21 14:47:48 2017 +0200 237| summary: Feature2 238| 239o <span style="color:olive;">changeset: 5:3966a515e569</span> 240| user: Boris Feld <boris.feld@octobus.net> 241| date: Wed Jun 21 14:47:48 2017 +0200 242| summary: Feature 243| 244o <span style="color:olive;">changeset: 4:bd3d94325819</span> 245| user: Boris Feld <boris.feld@octobus.net> 246| date: Wed Jun 21 14:47:49 2017 +0200 247| summary: Trunk2 248| 249o <span style="color:olive;">changeset: 3:120d3e4ce8b7</span> 250| user: Boris Feld <boris.feld@octobus.net> 251| date: Wed Jun 21 14:47:49 2017 +0200 252| summary: Trunk 253| 254o <span style="color:olive;">changeset: 2:36db121866a2</span> 255| user: Boris Feld <boris.feld@octobus.net> 256~ date: Wed Jun 21 14:47:48 2017 +0200 257 summary: Parent 258 259</pre> 260 261## With evolve 262 263<pre style="font-size: 0.25em !important;"> 264@ <span style="color:olive;">changeset: 10:2c1a992b87c3</span> 265| tag: tip 266| user: Boris Feld <boris.feld@octobus.net> 267| date: Wed Jun 21 14:50:39 2017 +0200 268| summary: Feature2 269| 270o <span style="color:olive;">changeset: 9:751113c206d0</span> 271| user: Boris Feld <boris.feld@octobus.net> 272| date: Wed Jun 21 14:50:39 2017 +0200 273| summary: Feature 274| 275o <span style="color:olive;">changeset: 8:9f9f3db01630</span> 276| user: Boris Feld <boris.feld@octobus.net> 277| date: Wed Jun 21 14:50:39 2017 +0200 278| summary: Trunk2 279| 280o <span style="color:olive;">changeset: 7:a5e9a3060e20</span> 281| parent: 4:32253567b531 282| user: Boris Feld <boris.feld@octobus.net> 283| date: Wed Jun 21 14:50:39 2017 +0200 284| summary: Trunk 285| 286| x <span style="color:olive;">changeset: 6:a57f1852d740</span> 287| | branch: feature 288| | user: Boris Feld <boris.feld@octobus.net> 289| | date: Wed Jun 21 14:50:39 2017 +0200 290| | summary: Feature2 291| | 292| x <span style="color:olive;">changeset: 5:896dc0771e5e</span> 293|/ branch: feature 294| user: Boris Feld <boris.feld@octobus.net> 295| date: Wed Jun 21 14:50:39 2017 +0200 296| summary: Feature 297| 298o <span style="color:olive;">changeset: 4:32253567b531</span> 299| user: Boris Feld <boris.feld@octobus.net> 300~ date: Wed Jun 21 14:50:39 2017 +0200 301 summary: Parent 302 303</pre> 304 305# How does it works? 306 307## It's smart 308 309<img src="https://media2.giphy.com/media/ZThQqlxY5BXMc/giphy.gif"> 310 311## Does Evolve only stores more changesets? (CHANGE) 312 313## Not only 314 315Remember our amend? 316 317<div class='graph' style='display: flex ;align-items: stretch ;flex-flow: row wrap ; align-items: center;'> 318<div class='left' style='order:1; width: 50%'> 319~~~graphviz 320 digraph G { 321 rankdir="BT"; 322 node[fixedsize=true, width=1, height=1, style="filled", fillcolor="#7F7FFF"]; 323 324 // Revisions 325 node[group=main]; 326 Parent -> "Fx bug"; 327 } 328~~~ 329</div> 330 331<div class='right' style='order:2; width: 50%'> 332 333~~~graphviz 334 digraph G { 335 rankdir="BT"; 336 graph[splines=polyline]; 337 node[fixedsize=true, width=1, height=1, style="filled", fillcolor="#7F7FFF"]; 338 339 // Revisions 340 node[group=main]; 341 Parent -> "Fix bug"; 342 } 343~~~ 344</div> 345</div> 346 347## More revisions 348 349<div class='graph' style='display: flex ;align-items: stretch ;flex-flow: row wrap ; align-items: center;'> 350<div class='left' style='order:1; width: 50%'> 351~~~graphviz 352 digraph G { 353 rankdir="BT"; 354 graph[splines=polyline]; 355 node[fixedsize=true, width=1, height=1, style="filled", fillcolor="#7F7FFF"]; 356 357 // Revisions 358 node[group=main]; 359 Parent -> "Fx bug"; 360 } 361~~~ 362</div> 363 364<div class='right' style='order:2; width: 50%'> 365 366~~~graphviz 367 digraph G { 368 rankdir="BT"; 369 graph[splines=polyline]; 370 node[fixedsize=true, width=1, height=1, style="filled", fillcolor="#7F7FFF"]; 371 372 // Revisions 373 node[group=main]; 374 Parent -> "Fix bug"; 375 node[group=obsolete]; 376 Parent -> "Fx bug"; 377 } 378~~~ 379</div> 380</div> 381 382## But hidden 383 384<div class='graph' style='display: flex ;align-items: stretch ;flex-flow: row wrap ; align-items: center;'> 385<div class='left' style='order:1; width: 50%'> 386~~~graphviz 387 digraph G { 388 rankdir="BT"; 389 graph[splines=polyline]; 390 node[fixedsize=true, width=1, height=1, style="filled", fillcolor="#7F7FFF"]; 391 392 // Revisions 393 node[group=main]; 394 Parent -> "Fx bug"; 395 } 396~~~ 397</div> 398 399<div class='right' style='order:2; width: 50%'> 400 401~~~graphviz 402 digraph G { 403 rankdir="BT"; 404 graph[splines=polyline]; 405 node[fixedsize=true, width=1, height=1, style="filled", fillcolor="#7F7FFF"]; 406 407 // Revisions 408 node[group=main]; 409 Parent -> "Fix bug"; 410 node[group=obsolete, style="dotted, filled", fillcolor="#DFDFFF"]; 411 Parent -> "Fx bug"; 412 } 413~~~ 414</div> 415</div> 416 417## Here is the smartness (change word)! 418 419~~~graphviz 420 digraph G { 421 rankdir="BT"; 422 node[fixedsize=true, width=1, height=1, style="filled", fillcolor="#7F7FFF"]; 423 424 // Revisions 425 node[group=main]; 426 Parent -> "Fix bug"; 427 node[group=obsolete, style="dotted, filled", fillcolor="#DFDFFF"]; 428 Parent -> "Fx bug"; 429 430 // Obsolescence links 431 edge[dir=back, style=dotted, arrowtail=dot]; 432 "Fx bug" -> "Fix bug"; 433 } 434~~~ 435 436## Obs markers 437 438Obs markers stores the relation between a changeset and its evolutions. 439 440XXX: Speak about META 441 442~~~graphviz 443 digraph G { 444 rankdir="BT"; 445 node[fixedsize=true, width=1, height=1, style="filled", fillcolor="#7F7FFF"]; 446 447 node[group=obsolete, style="dotted, filled" fillcolor="#DFDFFF"]; 448 edge[dir=back, style=dotted, arrowtail=dot]; 449 "Predecessor" -> "Successor"; 450 451 "Successor" [style="filled", fillcolor="#7F7FFF"]; 452 } 453~~~ 454 455 456# Phases 457 458## 3 phases 459 460Changesets can be in one of three phases: 461 462* Public 463* Draft 464* Secrets 465 466## Public 467 468The public phase holds changesets that have been exchanged publicly. 469 470Changesets in the public phase are expected to remain in your repository history and are said to be immutable. 471 472## Drafts 473 474The draft phase holds changesets that are not yet considered a part of the repository's permanent history. 475 476You can safely rewrite them. 477 478New commits are in the draft phase by default. 479 480## Secrets (hide) 481 482The secret phase holds changesets that you do not want to exchange with other repositories. 483 484Secret changesets are hidden from remote peers and will not be included in push operations. 485 486Manual operations or extensions may move a changeset into the secret phase. 487 488## Representation 489 490~~~graphviz 491 digraph G { 492 rankdir="BT"; 493 graph[splines=polyline]; 494 node[fixedsize=true, width=1, height=1, style="filled", fillcolor="#7F7FFF"]; 495 496 // Revisions 497 node[group=main]; 498 Public -> Draft -> Secret; 499 500 Draft [shape="pentagon"]; 501 Secret [shape="square"]; 502 } 503~~~ 504 505# Instability (add sub-titles, obsolete -> orphan, etc...) 506 507## Obsolete 508 509~~~graphviz 510 digraph G { 511 rankdir="BT"; 512 graph[splines=polyline]; 513 node[fixedsize=true, style="filled", width=1, height=1, fillcolor="#7F7FFF", shape="pentagon"]; 514 515 516 node[group=main]; 517 Root -> New; 518 node[group=obsolete]; 519 Root -> Obsolete; 520 521 // Obsolescence links 522 edge[dir=back, style=dotted, arrowtail=dot]; 523 Obsolete -> New; 524 525 Obsolete [fillcolor="#DFDFFF"]; 526 Root[shape="circle"]; 527 } 528~~~ 529 530## Orphan 531 532~~~graphviz 533 digraph G { 534 rankdir="BT"; 535 graph[splines=polyline]; 536 node[fixedsize=true, style="filled", width=1, height=1, fillcolor="#7F7FFF", shape="pentagon"]; 537 538 node[group=main]; 539 Root -> New; 540 node[group=obsolete]; 541 Root -> Obsolete -> Orphan; 542 543 // Obsolescence links 544 edge[dir=back, style=dotted, arrowtail=dot]; 545 Obsolete -> New; 546 547 Obsolete [fillcolor="#DFDFFF"]; 548 Orphan [fillcolor="#FF3535"]; 549 Root[shape="circle"]; 550 } 551~~~ 552 553## Phase-divergent 554 555## Content-divergent 556 557~~~graphviz 558 digraph G { 559 rankdir="BT"; 560 graph[splines=polyline]; 561 node[fixedsize=true, style="filled", width=1, height=1, fillcolor="#7F7FFF", shape="pentagon"]; 562 563 Root -> Base; 564 Root -> Content-divergent1; 565 Root -> Content-divergent2; 566 567 // Obsolescence links 568 edge[dir=back, style=dotted, arrowtail=dot]; 569 Base -> Content-divergent1; 570 Base -> Content-divergent2; 571 572 Base [shape="pentagon", fillcolor="#DFDFFF"]; 573 Content-divergent1 [fillcolor="#FF3535"]; 574 Content-divergent2 [fillcolor="#FF3535"]; 575 Root[shape="circle"]; 576 } 577~~~ 578 579# Topic 580 581# CHANGE TITLE (LATER IN THE FLOW) 582 583## Log on obsolete 584 585<pre style="font-size: 0.25em;"> 586$> hg log -G 587o <span style="color:olive;">changeset: 10:2c1a992b87c3</span> 588| tag: tip 589| user: Boris Feld <boris.feld@octobus.net> 590| date: Wed Jun 21 14:50:39 2017 +0200 591| summary: Feature2 592| 593o <span style="color:olive;">changeset: 9:751113c206d0</span> 594| user: Boris Feld <boris.feld@octobus.net> 595| date: Wed Jun 21 14:50:39 2017 +0200 596| summary: Feature 597| 598o <span style="color:olive;">changeset: 8:9f9f3db01630</span> 599| user: Boris Feld <boris.feld@octobus.net> 600| date: Wed Jun 21 14:50:39 2017 +0200 601| summary: Trunk2 602| 603o <span style="color:olive;">changeset: 7:a5e9a3060e20</span> 604| parent: 4:32253567b531 605| user: Boris Feld <boris.feld@octobus.net> 606| date: Wed Jun 21 14:50:39 2017 +0200 607| summary: Trunk 608| 609| @ <span style="color:olive;">changeset: 6:a57f1852d740</span> 610| | branch: feature 611| | user: Boris Feld <boris.feld@octobus.net> 612| | date: Wed Jun 21 14:50:39 2017 +0200 613| | summary: Feature2 614| | 615| x <span style="color:olive;">changeset: 5:896dc0771e5e</span> 616|/ branch: feature 617| user: Boris Feld <boris.feld@octobus.net> 618| date: Wed Jun 21 14:50:39 2017 +0200 619| summary: Feature 620| 621o <span style="color:olive;">changeset: 4:32253567b531</span> 622| user: Boris Feld <boris.feld@octobus.net> 623~ date: Wed Jun 21 14:50:39 2017 +0200 624 summary: Parent 625 626</pre> 627 628## Log with hidden 629 630<pre style="font-size: 0.25em;"> 631$ hg log -G --hidden 632@ <span style="color:olive;">changeset: 10:2c1a992b87c3</span> 633| tag: tip 634| user: Boris Feld <boris.feld@octobus.net> 635| date: Wed Jun 21 14:50:39 2017 +0200 636| summary: Feature2 637| 638o <span style="color:olive;">changeset: 9:751113c206d0</span> 639| user: Boris Feld <boris.feld@octobus.net> 640| date: Wed Jun 21 14:50:39 2017 +0200 641| summary: Feature 642| 643o <span style="color:olive;">changeset: 8:9f9f3db01630</span> 644| user: Boris Feld <boris.feld@octobus.net> 645| date: Wed Jun 21 14:50:39 2017 +0200 646| summary: Trunk2 647| 648o <span style="color:olive;">changeset: 7:a5e9a3060e20</span> 649| parent: 4:32253567b531 650| user: Boris Feld <boris.feld@octobus.net> 651| date: Wed Jun 21 14:50:39 2017 +0200 652| summary: Trunk 653| 654| x <span style="color:olive;">changeset: 6:a57f1852d740</span> 655| | branch: feature 656| | user: Boris Feld <boris.feld@octobus.net> 657| | date: Wed Jun 21 14:50:39 2017 +0200 658| | summary: Feature2 659| | 660| x <span style="color:olive;">changeset: 5:896dc0771e5e</span> 661|/ branch: feature 662| user: Boris Feld <boris.feld@octobus.net> 663| date: Wed Jun 21 14:50:39 2017 +0200 664| summary: Feature 665| 666o <span style="color:olive;">changeset: 4:32253567b531</span> 667| user: Boris Feld <boris.feld@octobus.net> 668~ date: Wed Jun 21 14:50:39 2017 +0200 669 summary: Parent 670 671</pre> 672 673## Obslog 674 675Behold our savior Obslog! 676 677## Obslog 678 679<pre class="shell_output"> 680$> hg obslog -r 3 681o <span style="color:olive;">c4414d4a5955</span> <span style="color:blue;">(3)</span> Fix bug 682| 683x <span style="color:olive;">9b5b4aa63d51</span> <span style="color:blue;">(1)</span> Fx bug 684 rewritten by <span style="color:green;">Boris Feld <boris.feld@octobus.net></span> <span style="color:teal;">(Wed Jun 21 14:50:38 2017 +0200)</span> as <span style="color:olive;">c4414d4a5955</span> 685 686</pre> 687 688<pre class="shell_output"> 689$> hg obslog -r 6 --all --hidden 690@ <span style="color:olive;">2c1a992b87c3</span> <span style="color:blue;">(10)</span> Feature2 691| 692x <span style="color:olive;">a57f1852d740</span> <span style="color:blue;">(6)</span> Feature2 693 rewritten by <span style="color:green;">Boris Feld <boris.feld@octobus.net></span> <span style="color:teal;">(Wed Jun 21 14:50:39 2017 +0200)</span> as <span style="color:olive;">2c1a992b87c3</span> 694 695</pre> 696 697Obslog is your next best friend! 698 699## Obslog 700 701<img src="https://media4.giphy.com/media/LxPsfUhFxwRRC/giphy.gif"> 702 703# Evolve Basics behind the hood 704 705## Amend 706 707<div class='graph' style='display: flex ;align-items: stretch ;flex-flow: row wrap ; align-items: center;'> 708<div class='left' style='order:1; width: 20%'> 709~~~graphviz 710 digraph G { 711 rankdir="BT"; 712 graph[splines=polyline]; 713 node[fixedsize=true, width=1, height=1, style="filled", fillcolor="#7F7FFF", shape="pentagon"]; 714 715 // Revisions 716 node[group=main]; 717 Root -> "A"; 718 Root [shape="circle"]; 719 } 720~~~ 721</div> 722 723<div class="middle" style='order:2; width: 60%'> 724To amend A: 725 726 hg amend -m 'A1' 727</div> 728 729<div class='right' style='order:2; width: 20%'> 730~~~graphviz 731 digraph G { 732 rankdir="BT"; 733 graph[splines=polyline]; 734 node[fixedsize=true, width=1, height=1, style="filled", fillcolor="#7F7FFF", shape="pentagon"]; 735 736 // Revisions 737 node[group=main]; 738 Root -> "A1"; 739 node[group=obsolete, style="dotted, filled", fillcolor="#DFDFFF"]; 740 Root -> "A"; 741 742 // Obsolescence links 743 edge[dir=back, style=dotted, arrowtail=dot]; 744 "A" -> "A1"; 745 Root [shape="circle"]; 746 } 747~~~ 748</div> 749</div> 750 751## Amend bis 752 753It also works with: 754 755 hg commit --amend -m 'A1' 756 757 758## Prune 759 760<div class='graph' style='display: flex ;align-items: stretch ;flex-flow: row wrap ; align-items: center;'> 761<div class='left' style='order:1; width: 20%'> 762~~~graphviz 763 digraph G { 764 rankdir="BT"; 765 graph[splines=polyline]; 766 node[fixedsize=true, width=1, height=1, style="filled", fillcolor="#7F7FFF", shape="pentagon"]; 767 768 // Revisions 769 node[group=main]; 770 Root -> "A"; 771 Root [shape="circle"]; 772 } 773~~~ 774</div> 775 776<div class="middle" style='order:2; width: 60%'> 777 778To prune A: 779 780 hg prune -r "desc(A)" 781</div> 782 783<div class='right' style='order:2; width: 20%'> 784~~~graphviz 785 digraph G { 786 rankdir="BT"; 787 graph[splines=polyline]; 788 node[fixedsize=true, width=1, height=1, style="filled", fillcolor="#7F7FFF", shape="pentagon"]; 789 790 Root [shape="circle"]; 791 792 // Revisions 793 node[group=obsolete, style="dotted, filled", fillcolor="#DFDFFF"]; 794 Root -> "A"; 795 } 796~~~ 797</div> 798</div> 799 800 801 802## Rebase 803 804<div class='graph' style='display: flex ;align-items: stretch ;flex-flow: row wrap ; align-items: center;'> 805<div class='left' style='order:1; width: 20%'> 806~~~graphviz 807 digraph G { 808 rankdir="BT"; 809 graph[splines=polyline]; 810 node[fixedsize=true, width=1, height=1, style="filled", fillcolor="#7F7FFF", shape="pentagon"]; 811 812 // Revisions 813 node[group=branch]; 814 Root -> B; 815 node[group=main]; 816 Root -> "A"; 817 818 Root [shape="circle"]; 819 } 820~~~ 821</div> 822 823<div class="middle" style='order:2; width: 60%'> 824 825In order to rebase A on top of B; 826 827 hg rebase -r "desc(A)" -d "desc(B)" 828 829</div> 830 831<div class='right' style='order:2; width: 20%'> 832~~~graphviz 833 digraph G { 834 rankdir="BT"; 835 graph[splines=polyline]; 836 node[fixedsize=true, width=1, height=1, style="filled", fillcolor="#7F7FFF", shape="pentagon"]; 837 838 // Revisions 839 node[group=branch]; 840 Root -> B -> "A'"; 841 842 node[group=obsolete, style="dotted, filled", fillcolor="#DFDFFF"]; 843 Root -> "A"; 844 845 // Obsolescence links 846 edge[dir=back, style=dotted, arrowtail=dot]; 847 "A" -> "A'"; 848 849 Root [shape="circle"]; 850 } 851~~~ 852</div> 853</div> 854 855 856# More advanced 857 858## Fold 859 860<div class='graph' style='display: flex ;align-items: stretch ;flex-flow: row wrap ; align-items: center;'> 861<div class='left' style='order:1; width: 15%'> 862 863~~~graphviz 864 digraph G { 865 rankdir="BT"; 866 graph[splines=polyline]; 867 node[fixedsize=true, width=1, height=1, style="filled", fillcolor="#7F7FFF", shape="pentagon"]; 868 869 // Revisions 870 node[group=branch]; 871 Root -> A -> B; 872 873 Root [shape="circle"]; 874 } 875~~~ 876</div> 877 878<div class="middle" style='order:2; width: 70%'> 879 880To fold A and B: 881 882 hg fold -r "desc(A)" -r "desc(B)" -m "C" 883 884</div> 885 886<div class='right' style='order:2; width: 15%'> 887 888~~~graphviz 889 digraph G { 890 rankdir="BT"; 891 graph[splines=polyline]; 892 node[fixedsize=true, width=1, height=1, style="filled", fillcolor="#7F7FFF", shape="pentagon"]; 893 894 // Revisions 895 node[group=branch]; 896 Root -> C; 897 898 node[group=obsolete, style="dotted, filled", fillcolor="#DFDFFF"]; 899 Root -> A -> B; 900 901 // Obsolescence links 902 edge[dir=back, style=dotted, arrowtail=dot]; 903 "A" -> "C"; 904 "B" -> "C"; 905 906 Root [shape="circle"]; 907 } 908~~~ 909 910</div> 911</div> 912 913 914## Split 915 916<div class='graph' style='display: flex ;align-items: stretch ;flex-flow: row wrap ; align-items: center;'> 917<div class='left' style='order:1; width: 20%'> 918~~~graphviz 919 digraph G { 920 rankdir="BT"; 921 graph[splines=polyline]; 922 node[fixedsize=true, width=1, height=1, style="filled", fillcolor="#7F7FFF", shape="pentagon"]; 923 924 // Revisions 925 node[group=branch]; 926 Root -> A; 927 928 Root [shape="circle"]; 929 } 930~~~ 931</div> 932 933<div class="middle" style='order:2; width: 60%'> 934 935Split in two: 936 937 hg split -r "desc(A)" 938</div> 939 940<div class='right' style='order:2; width: 20%'> 941~~~graphviz 942 digraph G { 943 rankdir="BT"; 944 graph[splines=polyline]; 945 node[fixedsize=true, width=1, height=1, style="filled", fillcolor="#7F7FFF", shape="pentagon"]; 946 947 // Revisions 948 node[group=branch]; 949 Root -> B -> C; 950 951 node[group=obsolete, style="dotted, filled", fillcolor="#DFDFFF"]; 952 Root -> A; 953 954 // Obsolescence links 955 edge[dir=back, style=dotted, arrowtail=dot]; 956 "A" -> "C"; 957 "A" -> "B"; 958 959 Root [shape="circle"]; 960 } 961~~~ 962</div> 963</div> 964 965 966# Warning zone 967 968## Divergence 969 970~~~graphviz 971 digraph G { 972 rankdir="BT"; 973 graph[splines=polyline]; 974 node[fixedsize=true, width=1, height=1, style="filled", fillcolor="#7F7FFF", shape="pentagon"]; 975 976 // Revisions 977 node[group=branch]; 978 Root -> "A"; 979 980 Root [shape="circle"]; 981 } 982~~~ 983 984## Divergence 985 986<div class='graph' style='display: flex ;align-items: stretch ;flex-flow: row wrap ; align-items: center;'> 987<div class='left' style='order:1; width: 30%'> 988~~~graphviz 989 digraph G { 990 rankdir="BT"; 991 graph[splines=polyline]; 992 node[fixedsize=true, width=1, height=1, style="filled", fillcolor="#7F7FFF", shape="pentagon"]; 993 994 // Revisions 995 node[group=branch]; 996 Root -> "B"; 997 998 node[group=obsolete, style="dotted, filled", fillcolor="#DFDFFF"]; 999 Root -> "A"; 1000 1001 // Obsolescence links 1002 edge[dir=back, style=dotted, arrowtail=dot]; 1003 "A" -> "B"; 1004 1005 Root [shape="circle"]; 1006 } 1007~~~ 1008</div> 1009 1010<div class="middle" style='order:2; width: 70%'> 1011 1012First amend: 1013 1014 hg amend -m B; 1015 1016</div> 1017</div> 1018 1019 1020## Divergence 2 1021 1022<div class='graph' style='display: flex ;align-items: stretch ;flex-flow: row wrap ; align-items: center;'> 1023 1024<div class="middle" style='order:1; width: 70%'> 1025 1026Second amend: 1027 1028 hg amend -m C 1029 1030</div> 1031 1032<div class='left' style='order:2; width: 30%'> 1033~~~graphviz 1034 digraph G { 1035 rankdir="BT"; 1036 graph[splines=polyline]; 1037 node[fixedsize=true, width=1, height=1, style="filled", fillcolor="#7F7FFF", shape="pentagon"]; 1038 1039 Root; 1040 1041 node[group=obsolete, style="dotted, filled", fillcolor="#DFDFFF"]; 1042 Root -> "A"; 1043 1044 // Revisions 1045 node[group=branch, fillcolor="#7F7FFF", style="filled"]; 1046 Root -> "C"; 1047 1048 // Obsolescence links 1049 edge[dir=back, style=dotted, arrowtail=dot]; 1050 "A" -> "C"; 1051 1052 Root [shape="circle"]; 1053 } 1054~~~ 1055</div> 1056</div> 1057 1058## Result 1059 1060~~~graphviz 1061 digraph G { 1062 rankdir="BT"; 1063 graph[splines=polyline]; 1064 node[fixedsize=true, style="filled", width=1, height=1, fillcolor="#7F7FFF", shape="pentagon"]; 1065 1066 node[group=main]; 1067 Root -> "B"; 1068 node[group=divergence]; 1069 Root -> "C"; 1070 node[group=obsolete, style="dotted, filled", fillcolor="#DFDFFF"]; 1071 Root -> "A"; 1072 1073 // Obsolescence links 1074 edge[dir=back, style=dotted, arrowtail=dot]; 1075 A -> B; 1076 A -> C; 1077 1078 Root [shape="pentagon"]; 1079 B [fillcolor="#FF3535"]; 1080 C [fillcolor="#FF3535"]; 1081 Root[shape="circle"]; 1082 } 1083~~~ 1084 1085## That's gonna hurt! 1086 1087# Stabilization 1088 1089## Stabilization with amend 1090 1091~~~graphviz 1092 digraph G { 1093 rankdir="BT"; 1094 graph[splines=polyline]; 1095 node[fixedsize=true, style="filled", width=1, height=1, fillcolor="#7F7FFF", shape="pentagon"]; 1096 1097 node[group=main]; 1098 Root -> "A'"; 1099 node[group=obsolete, style="dotted, filled", fillcolor="#DFDFFF"]; 1100 Root -> "A" -> B; 1101 1102 // Obsolescence links 1103 edge[dir=back, style=dotted, arrowtail=dot]; 1104 "A" -> "A'"; 1105 1106 B[fillcolor="#FF3535"]; 1107 Root[shape="circle"]; 1108 } 1109~~~ 1110 1111## Evolve! 1112 1113<div class='graph' style='display: flex ;align-items: stretch ;flex-flow: row wrap ; align-items: center;'> 1114<div class="middle" style='order:2; width: 50%'> 1115 1116Stabilize repo: 1117 1118 hg evolve --all 1119</div> 1120<div class='right' style='order:2; width: 50%'> 1121~~~graphviz 1122 digraph G { 1123 rankdir="BT"; 1124 graph[splines=polyline]; 1125 node[fixedsize=true, style="filled", width=1, height=1, fillcolor="#7F7FFF", shape="pentagon"]; 1126 1127 node[group=main]; 1128 Root -> "A'" -> "B'"; 1129 node[group=obsolete, style="dotted, filled", fillcolor="#DFDFFF"]; 1130 Root -> "A" -> B; 1131 1132 // Obsolescence links 1133 edge[dir=back, style=dotted, arrowtail=dot]; 1134 "A" -> "A'"; 1135 "B" -> "B'"; 1136 1137 Root[shape="circle"]; 1138 } 1139~~~ 1140 1141</div> 1142</div> 1143 1144# Future is near! 1145 1146## Effect-flag 1147 1148Remember our obs-markers? 1149 1150They are great for evolution, but how do you know what changed between two evolutions? 1151 1152## Effect-flag 1153 1154Effect-flag are storing what changed between evolutions. You can view them with `obslog`, who else? 1155 1156## Effect-flag 1157 1158Does the meta only changed? 1159 1160<pre class="shell_output"> 1161o <span style="color:olive;">5732d5ea6aa2</span> <span style="color:blue;">(2)</span> Fix bug 1162| 1163@ <span style="color:olive;">aa3cd7ee52fc</span> <span style="color:blue;">(1)</span> Fx bug 1164 rewritten(description) by <span style="color:green;">Boris Feld <boris.feld@octobus.net></span> <span style="color:teal;">(Wed Jun 21 15:49:54 2017 +0200)</span> as <span style="color:olive;">5732d5ea6aa2</span> 1165 1166</pre> 1167 1168## Or did the code changed? 1169 1170<pre class="shell_output"> 1171@ <span style="color:olive;">8f824718f3f7</span> <span style="color:blue;">(12)</span> Fix the build 1172| 1173x <span style="color:olive;">f9310b4b05e1</span> <span style="color:blue;">(10)</span> Fix the build 1174 rewritten(content) by <span style="color:green;">Boris Feld <boris.feld@octobus.net></span> <span style="color:teal;">(Wed Jun 21 15:53:07 2017 +0200)</span> as <span style="color:olive;">8f824718f3f7</span> 1175 1176</pre> 1177 1178## Or was rebased? 1179 1180<pre class="shell_output"> 1181o <span style="color:olive;">ab709059df38</span> <span style="color:blue;">(9)</span> Feature2 1182| 1183@ <span style="color:olive;">3d61cb9ab34f</span> <span style="color:blue;">(5)</span> Feature2 1184 rewritten(branch, parent) by <span style="color:green;">Boris Feld <boris.feld@octobus.net></span> <span style="color:teal;">(Wed Jun 21 15:53:06 2017 +0200)</span> as <span style="color:olive;">ab709059df38</span> 1185 1186</pre> 1187 1188## Obslog 1189 1190<img src="https://media0.giphy.com/media/3oriO13KTkzPwTykp2/giphy.gif"> 1191 1192## Obsfate 1193 1194<pre class="shell_output"> 1195o 8f824718f3f7 1196| 1197| x f39472eb8519 1198| | Obsfate: pruned by Boris Feld <boris.feld@octobus.net> (at 2017-06-21 15:53 +0200) 1199| | 1200| x f9310b4b05e1 1201|/ Obsfate: rewritten by Boris Feld <boris.feld@octobus.net> as 8f824718f3f7 (at 2017-06-21 15:53 +0200) 1202| 1203o ab709059df38 1204| 1205o b0d7c614e47d 1206| 1207o d61083b45bba 1208| 1209o 50ebd46e2452 1210| 1211| @ 3d61cb9ab34f 1212| | Obsfate: rewritten by Boris Feld <boris.feld@octobus.net> as ab709059df38 (at 2017-06-21 15:53 +0200) 1213| | 1214| x 1c6a75c00a45 1215|/ Obsfate: rewritten by Boris Feld <boris.feld@octobus.net> as b0d7c614e47d (at 2017-06-21 15:53 +0200) 1216| 1217o c1bdb750ab80 1218| 1219o 39752c0e48a4 1220| 1221| x 36744bfd9d65 1222|/ Obsfate: rewritten by Boris Feld <boris.feld@octobus.net> as 39752c0e48a4 (at 2017-06-21 15:53 +0200) 1223| 1224o 7d12a4681f84 1225</pre> 1226 1227## Obslog --patch 1228 1229<pre class="shell_output"> 1230$> hg obslog --patch 1231x <span style="color:olive;">19fb99aaa0d5</span> <span style="color:blue;">(3594)</span> obslog: add a patch option 1232| rewritten(content) by <span style="color:green;">Pierre-Yves David <pierre-yves.david@octobus.net></span> <span style="color:teal;">(Mon Jun 19 19:25:18 2017 +0200)</span> as <span style="color:olive;">81b01fe6db3b</span> 1233| diff -r 19fb99aaa0d5 -r 81b01fe6db3b hgext3rd/evolve/obshistory.py 1234| --- a/hgext3rd/evolve/obshistory.py Mon Jun 19 19:00:36 2017 +0200 1235| +++ b/hgext3rd/evolve/obshistory.py Mon Jun 19 19:00:36 2017 +0200 1236| @@ -105,6 +105,10 @@ 1237| markerfm.plain('\n') 1238| 1239| # Patch 1240| + 1241| +# XXX-review: I find it a bit hacky always call showpatch and expect it to not 1242| +# XXX-review: show anything without --patch. I would prefer and explicite condition for 1243| +# XXX-review: calling showpatch. 1244| self.showpatch(ctx, matchfn) 1245| 1246| self.hunk[ctx.node()] = self.ui.popbuffer() 1247| ... 1248| 1249| o <span style="color:olive;">a788967aa800</span> <span style="color:blue;">(3593)</span> obslog: clarify some sorting code 1250| | 1251x | <span style="color:olive;">4c2be5027b23</span> 1252|/ rewritten(user) by <span style="color:green;">Pierre-Yves David <pierre-yves.david@octobus.net></span> <span style="color:teal;">(Mon Jun 19 19:00:54 2017 +0200)</span> as <span style="color:olive;">19fb99aaa0d5</span> 1253| (No patch available yet, context is not local) 1254| 1255x <span style="color:olive;">5d04c9bfac7e</span> 1256| rewritten(description, user, date, parent, content) by <span style="color:green;">Pierre-Yves David <pierre-yves.david@octobus.net></span> <span style="color:teal;">(Mon Jun 19 19:00:36 2017 +0200)</span> as <span style="color:olive;">4c2be5027b23, a788967aa800</span> 1257| (No patch available yet, context is not local) 1258| 1259x <span style="color:olive;">8ddfd687cf57</span> <span style="color:blue;">(3559)</span> obslog: add a patch option 1260| rewritten(parent) by <span style="color:green;">Pierre-Yves David <pierre-yves.david@octobus.net></span> <span style="color:teal;">(Mon Jun 19 18:59:02 2017 +0200)</span> as <span style="color:olive;">5d04c9bfac7e</span> 1261| (No patch available yet, succ is unknown locally) 1262| 1263x <span style="color:olive;">27d388000e90</span> <span style="color:blue;">(3541)</span> obslog: add a patch option 1264 rewritten(content) by <span style="color:green;">Boris Feld <boris.feld@octobus.net></span> <span style="color:teal;">(Mon Jun 19 18:40:16 2017 +0200)</span> as <span style="color:olive;">8ddfd687cf57</span> 1265</pre> 1266 1267 1268# Conclusion 1269 1270<div class='graph' style='display: flex ;align-items: stretch ;flex-flow: row wrap ; align-items: center;'> 1271<div class='left' style='order:1; width: 20%'> 1272~~~graphviz 1273 digraph G{} 1274~~~ 1275</div> 1276 1277<div class="middle" style='order:2; width: 60%'> 1278To stuff: 1279 1280 hg 1281</div> 1282 1283<div class='right' style='order:2; width: 20%'> 1284~~~graphviz 1285 digraph G{} 1286~~~ 1287</div> 1288</div> 1289