label: rename 'evolve.short_node' to 'evolve.node'
A wider labelk will helps compatibility.
Initialsetup-------------ThisMercurialconfigurationexampleisusedfortesting...Varioussetup$cat>>$HGRCPATH<<EOF>[ui]>#Thisischangethedefaultoutputoflogforcleartutorial>logtemplate="{node|short} ({phase}): {desc}\n">[diff]>#use"git"diffformat,clearerandsmarterformat>git=1>[alias]>#"-d '0 0'"meansthatthenewcommitwillbeatJanuary1st1970.>#Thisisusedforstablehashduringtest>#(thistutorialisautomaticallytested.)>amend=amend-d'0 0'>EOF$hginitlocal$cat>>local/.hg/hgrc<<EOF>[paths]>remote=../remote>other=../other>[ui]>user=BabartheKing>EOF$hginitremote$cat>>remote/.hg/hgrc<<EOF>[paths]>local=../local>[ui]>user=CelestinetheQueen>EOF$hginitother$cat>>other/.hg/hgrc<<EOF>[ui]>user=PrincessFlore>EOFThistutorialusesthefollowingconfigurationforMercurial:Acompactlogtemplatewithphasedata:$hgshowconfigui|greplogui.logtemplate="{node|short} ({phase}): {desc}\n"Improvedgitformatdiff:$hgshowconfigdiffdiff.git=1Andofcourse,weenabletheexperimentalextensionsformutablehistory:$cat>>$HGRCPATH<<EOF>[extensions]>evolve=$TESTDIR/../hgext3rd/evolve/>#enablingrebaseisalsoneededfornow>rebase=>EOF-----------------------SingleDeveloperUsage-----------------------Thistutorialshowshowtouseevolutiontorewritehistorylocally.Fixingmistakewith`hgamend`--------------------------------Weareversioningashoppinglist$cdlocal$cat>>shopping<<EOF>Spam>Whizzobutter>Albatross>Rat(ratheralot)>Juggedfish>Blancmange>Salmonmousse>EOF$hgcommit-A-m"Monthy Python Shopping list"addingshoppingItsfirstversionissharedwiththeoutside.$hgpushremotepushingto$TESTTMP/remote(glob)searchingforchangesaddingchangesetsaddingmanifestsaddingfilechangesadded1changesetswith1changesto1filesLaterIaddadditionalitemtomylist$cat>>shopping<<EOF>Egg>Suggar>Vinegar>Oil>EOF$hgcommit-m"adding condiment"$cat>>shopping<<EOF>Bananos>Pear>Apple>EOF$hgcommit-m"adding fruit"Thishistoryisverylinear$hglog-G@d85de4546133(draft):addingfruit|o4d5dc8187023(draft):addingcondiment|o7e82d3f3c2cb(public):MonthyPythonShoppinglistButatypowasmadeinBabanas!$hgexporttip # HG changeset patch # User test # Date 0 0 # Thu Jan 01 00:00:00 1970 +0000 # Node ID d85de4546133030c82d257bbcdd9b1b416d0c31c # Parent 4d5dc81870237d492284826e21840b2ca00e26d1addingfruitdiff--gita/shoppingb/shopping---a/shopping+++b/shopping@@-9,3+9,6@@SuggarVinegarOil+Bananos+Pear+AppleThefaultychangesetisinthe"draft"phasebecauseithasnotbeenexchangedwiththeoutside.Thefirstonehasbeenexchangedandis"public"(immutable).$hglog-G@d85de4546133(draft):addingfruit|o4d5dc8187023(draft):addingcondiment|o7e82d3f3c2cb(public):MonthyPythonShoppinglisthopefully.Icanuse`hgcommit--amend`torewritemyfaultychangeset!$sed-i''-es/Bananos/Banana/shopping$hgdiffdiff--gita/shoppingb/shopping---a/shopping+++b/shopping@@-9,6+9,6@@SuggarVinegarOil-Bananos+BananaPearApple$hgcommit--amendAnewchangesetwiththerightdiffreplacethewrongone.$hglog-G@9d0363b81950(draft):addingfruit|o4d5dc8187023(draft):addingcondiment|o7e82d3f3c2cb(public):MonthyPythonShoppinglist$hgexporttip # HG changeset patch # User test # Date 0 0 # Thu Jan 01 00:00:00 1970 +0000 # Node ID 9d0363b81950646bc6ad1ec5de8b8197ea586541 # Parent 4d5dc81870237d492284826e21840b2ca00e26d1addingfruitdiff--gita/shoppingb/shopping---a/shopping+++b/shopping@@-9,3+9,6@@SuggarVinegarOil+Banana+Pear+AppleGettingridofbranchyhistory----------------------------------WhileIwasworkingonmylist.someonemadeachangeremotely.$cd../remote$hgup-q$sed-i''-e's/Spam/Spam Spam Spam/'shopping$hgci-m'SPAM'$cd../localI'll get this remote changeset when pulling $ hg pull remote pulling from $TESTTMP/remote (glob) searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) (run 'hgheads' to see heads, 'hgmerge' to merge)I now have a new heads. Note that this remote head is immutable $ hg log -G o 9ca060c80d74 (public): SPAM | | @ 9d0363b81950 (draft): adding fruit | | | o 4d5dc8187023 (draft): adding condiment |/ o 7e82d3f3c2cb (public): Monthy Python Shopping listinstead of merging my head with the new one. I'mgoingtorebasemywork$hgdiff$hgrebase--dest9ca060c80d74--source4d5dc8187023rebasing1:4d5dc8187023"adding condiment"mergingshoppingrebasing4:9d0363b81950"adding fruit"mergingshoppingMylocalworkisnowrebasedontheremoteone.$hglog-G@41aff6a42b75(draft):addingfruit|odfd3a2d7691e(draft):addingcondiment|o9ca060c80d74(public):SPAM|o7e82d3f3c2cb(public):MonthyPythonShoppinglistRemovingchangesets------------------------Iaddnewitemtomylist$cat>>shopping<<EOF>car>bus>plane>boat>EOF$hgci-m'transport'$hglog-G@1125e39fbf21(draft):transport|o41aff6a42b75(draft):addingfruit|odfd3a2d7691e(draft):addingcondiment|o9ca060c80d74(public):SPAM|o7e82d3f3c2cb(public):MonthyPythonShoppinglistIhaveanewcommitbutIrealizethatdon't want it. (transport shop list doesnot fit well in my standard shopping list) $ hg prune . # "." is for working directory parent 1 files updated, 0 files merged, 0 files removed, 0 files unresolved working directory now at 41aff6a42b75 1 changesets prunedThe silly changeset is gone. $ hg log -G @ 41aff6a42b75 (draft): adding fruit | o dfd3a2d7691e (draft): adding condiment | o 9ca060c80d74 (public): SPAM | o 7e82d3f3c2cb (public): Monthy Python Shopping listReordering changesets------------------------We create two changesets. $ cat >> shopping <<EOF>Shampoo>Toothbrush>...Morebathroomstufftocome>Towel>Soap>EOF$hgci-m'bathroom stuff'-q#XXXremovethe-q$sed-i''-e's/Spam/Spam Spam Spam/g'shopping$hgci-m'SPAM SPAM'$hglog-G@fac207dec9f5(draft):SPAMSPAM|o10b8aeaa8cc8(draft):bathroomstuff|o41aff6a42b75(draft):addingfruit|odfd3a2d7691e(draft):addingcondiment|o9ca060c80d74(public):SPAM|o7e82d3f3c2cb(public):MonthyPythonShoppinglist..note::Wecan't amend changeset 7e82d3f3c2cb or 9ca060c80d74 as they are immutable. I now want to push to remote all my changes except the bathroom one, which I'mnottotallyhappywithyet.Tobeabletopush"SPAM SPAM"Ineedaversionof"SPAM SPAM"whichisnotachildof"bathroom stuff"Youcanusethe'grab'aliasforthat...note:grabisanaliasfor`hgrebase--dest.--rev<target>;hgup<there>`$hgup'p1(10b8aeaa8cc8)'#goingon"bathroom stuff"parent1filesupdated,0filesmerged,0filesremoved,0filesunresolved$hggrabfac207dec9f5#moving"SPAM SPAM"totheworkingdirectoryparentrebasing10:fac207dec9f5"SPAM SPAM"(tip)mergingshopping?filesupdated,0filesmerged,0filesremoved,0filesunresolved(glob)$hglog-G@a224f2a4fb9f(draft):SPAMSPAM||o10b8aeaa8cc8(draft):bathroomstuff|/o41aff6a42b75(draft):addingfruit|odfd3a2d7691e(draft):addingcondiment|o9ca060c80d74(public):SPAM|o7e82d3f3c2cb(public):MonthyPythonShoppinglistWehaveanewSPAMSPAMversionwithoutthebathroomstuff$grepSpamshopping#enoughspamSpamSpamSpamSpamSpamSpamSpamSpamSpam$grepToothbrushshopping#noToothbrush[1]$hgexport. # HG changeset patch # User test # Date 0 0 # Thu Jan 01 00:00:00 1970 +0000 # Node ID a224f2a4fb9f9f828f608959912229d7b38b26de # Parent 41aff6a42b7578ec7ec3cb2041633f1ca43cca96SPAMSPAMdiff--gita/shoppingb/shopping---a/shopping+++b/shopping@@-1,4+1,4@@-SpamSpamSpam+SpamSpamSpamSpamSpamSpamSpamSpamSpamWhizzobutterAlbatrossRat(ratheralot)TomakesureIdonotpushunreadychangesetbymistakeIsetthe"bathroomstuff"changesetinthesecretphase.$hgphase--force--secret10b8aeaa8cc8wecannowpushourchange:$hgpushremotepushingto$TESTTMP/remote(glob)searchingforchangesaddingchangesetsaddingmanifestsaddingfilechangesadded3changesetswith3changesto1files6newobsolescencemarkersforsimplicitysakewegetthebathroomchangeinlineagain$hggrab10b8aeaa8cc8rebasing9:10b8aeaa8cc8"bathroom stuff"mergingshopping?filesupdated,0filesmerged,0filesremoved,0filesunresolved(glob)$hgphase--draft.$hglog-G@75954b8cd933(draft):bathroomstuff|oa224f2a4fb9f(public):SPAMSPAM|o41aff6a42b75(public):addingfruit|odfd3a2d7691e(public):addingcondiment|o9ca060c80d74(public):SPAM|o7e82d3f3c2cb(public):MonthyPythonShoppinglistSplittingchange------------------Thispartisnotwrittenyet,butyoucanuseeitherthe`histedit`extensionofthe`uncommit`commandtosplittingachange.$hghelpuncommithguncommit[OPTION]...[NAME]movechangesfromparentrevisiontoworkingdirectoryChangestoselectedfilesinthecheckedoutrevisionappearagainasuncommittedchangedintheworkingdirectory.Anewrevisionwithouttheselectedchangesiscreated,becomesthecheckedoutrevision,andobsoletesthepreviousone.The--includeoptionspecifiespatternstouncommit.The--excludeoptionspecifiespatternstokeepinthecommit.The--revargumentletyouchangethecommitfiletoacontentofanotherrevision.Itstilldoesnotchangethecontentofyourfileintheworkingdirectory.Return0ifchangedfilesareuncommitted.options([+]canberepeated):-a--alluncommitallchangeswhennoargumentsgiven-r--revVALUErevertcommitcontenttoREVinstead-I--includePATTERN[+]includenamesmatchingthegivenpatterns-X--excludePATTERN[+]excludenamesmatchingthegivenpatterns(somedetailshidden,use--verbosetoshowcompletehelp)Theeditcommandofhisteditcanbeusedtosplitchangeset:Collapsingchange------------------Thetutorialpartisnotwrittenyetbutcanuse`hgfold`:$hghelpfoldhgfold[OPTION]...[-r]REValiases:squashfoldmultiplerevisionsintoasingleoneWith--from,foldsalltherevisionslinearlybetweenthegivenrevisionsandtheparentoftheworkingdirectory.With--exact,foldsonlythespecifiedrevisionswhileignoringtheparentoftheworkingdirectory.Inthiscase,thegivenrevisionsmustformalinearunbrokenchain.options([+]canberepeated):-r--revVALUE[+]revisiontofold--exactonlyfoldspecifiedrevisions--fromfoldrevisionslinearlytoworkingcopyparent-m--messageTEXTusetextascommitmessage-l--logfileFILEreadcommitmessagefromfile-d--dateDATErecordthespecifieddateascommitdate-u--userUSERrecordthespecifieduserascommitter(somedetailshidden,use--verbosetoshowcompletehelp)-----------------------Collaboration-----------------------sharingmutablechangesets----------------------------Tosharemutablechangesetswithothers,justcheckthattherepoyouinteractwithis"not publishing".Otherwiseyouwillgetthepreviouslyobservebehaviorwhereexchangedchangesetareautomaticallypublished.$cd../remote$hg-R../local/showconfigphases[1]thelocalrepodoesnothaveanyspecificconfigurationfor`phases.publish`.Itis``true``bydefault.$hgpulllocalpullingfrom$TESTTMP/local(glob)searchingforchangesaddingchangesetsaddingmanifestsaddingfilechangesadded1changesetswith1changesto1files1newobsolescencemarkers(run'hg update'togetaworkingcopy)$hglog-Go75954b8cd933(public):bathroomstuff|oa224f2a4fb9f(public):SPAMSPAM|o41aff6a42b75(public):addingfruit|odfd3a2d7691e(public):addingcondiment|@9ca060c80d74(public):SPAM|o7e82d3f3c2cb(public):MonthyPythonShoppinglistWedonotwanttopublishthe"bathroom changeset".Let's rollback the last transaction... Warning: Rollback is actually a dangerous kind of internal command that is deprecated and should not be exposed to user. Please forget you read about it until someone fix this tutorial. $ hg rollback repository tip rolled back to revision 4 (undo pull) $ hg log -G o a224f2a4fb9f (public): SPAM SPAM | o 41aff6a42b75 (public): adding fruit | o dfd3a2d7691e (public): adding condiment | @ 9ca060c80d74 (public): SPAM | o 7e82d3f3c2cb (public): Monthy Python Shopping listLet'smakethelocalrepo"non publishing"$echo'[phases]'>> ../local/.hg/hgrc $ echo 'publish=false' >> ../local/.hg/hgrc $ echo '[phases]' >> .hg/hgrc $ echo 'publish=false' >> .hg/hgrc $ hg showconfig phases phases.publish=false $ hg -R ../local/ showconfig phases phases.publish=falseI can now exchange mutable changeset between "remote" and "local" repository. $ hg pull local pulling from $TESTTMP/local (glob) searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files 1 new obsolescence markers (run 'hgupdate' to get a working copy) $ hg log -G o 75954b8cd933 (draft): bathroom stuff | o a224f2a4fb9f (public): SPAM SPAM | o 41aff6a42b75 (public): adding fruit | o dfd3a2d7691e (public): adding condiment | @ 9ca060c80d74 (public): SPAM | o 7e82d3f3c2cb (public): Monthy Python Shopping listRebasing unstable change after pull----------------------------------------------Remotely someone add a new changeset on top of the mutable "bathroom" on. $ hg up 75954b8cd933 -q $ cat >> shopping <<EOF>Giraffe>Rhino>Lion>Bear>EOF$hgci-m'animals'Butatthesametime,locally,thissame"bathroom changeset"wasupdated.$cd../local$hgup75954b8cd933-q$sed-i''-e's/... More bathroom stuff to come/Bath Robe/'shopping$hgcommit--amend$hglog-G@a44c85f957d3(draft):bathroomstuff|oa224f2a4fb9f(public):SPAMSPAM|o41aff6a42b75(public):addingfruit|odfd3a2d7691e(public):addingcondiment|o9ca060c80d74(public):SPAM|o7e82d3f3c2cb(public):MonthyPythonShoppinglistWhenwepullfromremoteagainwegetanunstablestate!$hgpullremotepullingfrom$TESTTMP/remote(glob)searchingforchangesaddingchangesetsaddingmanifestsaddingfilechangesadded1changesetswith1changesto1files(+1heads)(run'hg heads'toseeheads,'hg merge'tomerge)1newunstablechangesetsThenewchangeset"animal"isbasedonanoldchangesetof"bathroom".Youcanseebothversionshowingupinthelog.$hglog-Gobf1b0d202029(draft):animals||@a44c85f957d3(draft):bathroomstuff||x|75954b8cd933(draft):bathroomstuff|/oa224f2a4fb9f(public):SPAMSPAM|o41aff6a42b75(public):addingfruit|odfd3a2d7691e(public):addingcondiment|o9ca060c80d74(public):SPAM|o7e82d3f3c2cb(public):MonthyPythonShoppinglistTheolderversion75954b8cd933neverceasedtoexistinthelocalrepo.Itwasjusthiddenandexcludedfrompullandpush...note::Inhgviewthereisanicedottedrelationhighlightinga44c85f957d3asanewversionof75954b8cd933.thisisnotyetportedto``hglog-G``.Thereisnowan**unstable**changesetinthishistory.Mercurialwillrefusetoshareitwiththeoutside:$hgpushotherpushingto$TESTTMP/other(glob)searchingforchangesabort:pushincludesunstablechangeset:bf1b0d202029!(use'hg evolve'togetastablehistoryor--forcetoignorewarnings)[255]Toresolvethisunstablestate,youneedtorebasebf1b0d202029ontoa44c85f957d3.The`hgevolve`commandwilldothisforyou.Ithasa--dry-runoptiontoonlysuggestthenextmove.$hgevolve--dry-runmove:[15]animalsatop:[14]bathroomstuffhgrebase-rbf1b0d202029-da44c85f957d3Let's do it $ hg evolve move:[15] animals atop:[14] bathroom stuff merging shopping working directory is now at ee942144f952The old version of bathroom is hidden again. $ hg log -G @ ee942144f952 (draft): animals | o a44c85f957d3 (draft): bathroom stuff | o a224f2a4fb9f (public): SPAM SPAM | o 41aff6a42b75 (public): adding fruit | o dfd3a2d7691e (public): adding condiment | o 9ca060c80d74 (public): SPAM | o 7e82d3f3c2cb (public): Monthy Python Shopping listWe can push this evolution to remote $ hg push remote pushing to $TESTTMP/remote (glob) searching for changes adding changesets adding manifests adding file changes added 2 changesets with 2 changes to 1 files (+1 heads) 3 new obsolescence markersremote get a warning that current working directory is based on an obsolete changeset $ cd ../remote $ hg pull local # we up again to trigger the warning. it was displayed during the push pulling from $TESTTMP/local (glob) searching for changes no changes found working directory parent is obsolete! (bf1b0d202029) (use 'hgevolve' to update to its successor: ee942144f952)now let'sseewhereweare,andupdatetothesuccessor$hgparentsbf1b0d202029(draft):animalsworkingdirectoryparentisobsolete!(bf1b0d202029)(use'hg evolve'toupdatetoitssuccessor:ee942144f952)$hgevolveupdate:[8]animals1filesupdated,0filesmerged,0filesremoved,0filesunresolvedworkingdirectoryisnowatee942144f952Relocatingunstablechangeafterprune----------------------------------------------Theremoteguykeepworking$sed-i''-e's/Spam/Spam Spam Spam Spam/g'shopping$hgcommit-m"SPAM SPAM SPAM"I'm pulling its work locally. $ cd ../local $ hg pull remote pulling from $TESTTMP/remote (glob) searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (run 'hgupdate' to get a working copy) $ hg log -G o 99f039c5ec9e (draft): SPAM SPAM SPAM | @ ee942144f952 (draft): animals | o a44c85f957d3 (draft): bathroom stuff | o a224f2a4fb9f (public): SPAM SPAM | o 41aff6a42b75 (public): adding fruit | o dfd3a2d7691e (public): adding condiment | o 9ca060c80d74 (public): SPAM | o 7e82d3f3c2cb (public): Monthy Python Shopping listIn the mean time I noticed you can'tbuyanimalsinasupermarketandIprunetheanimalchangeset:$hgpruneee942144f9521filesupdated,0filesmerged,0filesremoved,0filesunresolvedworkingdirectorynowata44c85f957d31changesetspruned1newunstablechangesetsTheanimalschangesetisstilldisplayedbecausethe"SPAM SPAM SPAM"changesetisneitherdeadorobsolete.Myrepositoryisinanunstablestateagain.$hglog-Go99f039c5ec9e(draft):SPAMSPAMSPAM|xee942144f952(draft):animals|@a44c85f957d3(draft):bathroomstuff|oa224f2a4fb9f(public):SPAMSPAM|o41aff6a42b75(public):addingfruit|odfd3a2d7691e(public):addingcondiment|o9ca060c80d74(public):SPAM|o7e82d3f3c2cb(public):MonthyPythonShoppinglist$hglog-r'unstable()'99f039c5ec9e(draft):SPAMSPAMSPAM$hgevolvemove:[17]SPAMSPAMSPAMatop:[14]bathroomstuffmergingshoppingworkingdirectoryisnowat40aa40daeefb$hglog-G@40aa40daeefb(draft):SPAMSPAMSPAM|oa44c85f957d3(draft):bathroomstuff|oa224f2a4fb9f(public):SPAMSPAM|o41aff6a42b75(public):addingfruit|odfd3a2d7691e(public):addingcondiment|o9ca060c80d74(public):SPAM|o7e82d3f3c2cb(public):MonthyPythonShoppinglistHandlingDivergentamend----------------------------------------------Wecandetectthatmultipledivergingamendmentshavebeenmade.The`evolve`commandcansolvethissituation.Butallcornercasearenothandlednow.Thissectionneedstobewritten.