obslog: check filtered output with folded changesets
$."$TESTDIR/testlib/topic_setup.sh"$hginitpinky$cdpinky$cat<<EOF>>.hg/hgrc>[phases]>publish=false>EOF$cat<<EOF>>$HGRCPATH>[experimental]>#disablethenewgraphstyleuntilwedrop3.7support>graphstyle.missing=|>EOF$hghelp-etopictopicextension-supportfortopicbranchesTopicbranchesarelightweightbrancheswhichdisappearwhenchangesarefinalized(movetothepublicphase).Comparedtobookmark,topicisreferencecarriedbyeachchangesetsoftheseriesinsteadofjustthesingleheadrevision.Topicarequitesimilartothewaynamedbranchwork,excepttheyeventuallyfadeawaywhenthechangesetbecomespartoftheimmutablehistory.Changesetcanbelongtobothatopicandanamedbranch,butaslongasitismutable,itstopicidentitywillprevail.Asaresult,defaultdestinationfor'update','merge',etc...willtaketopicintoaccount.Whenatopicisactivetheseoperationswillonlyconsiderotherchangesetsonthattopic(and,insomeoccurrence,barechangesetonsamebranch).Whennotopicisactive,changesetwithtopicwillbeignoredandonlybareoneonthesamebranchwillbetakeninaccount.Thereiscurrentlytwocommandstobeusedwiththatextension:'topics'and'stack'.The'hg topics'commandisusedtosetthecurrenttopic,changeandlistexistingone.'hg topics --verbose'willlistvariousinformationrelatedtoeachtopic.The'stack'willshowyouinformationaboutthestackofcommitbelongingtoyourcurrenttopic.Topicisofferingyoualiasesreferencetochangesetinyourcurrenttopicstackas't#'.Forexample,'t1'referstotherootofyourstack,'t2'tothesecondcommits,etc.The'hg stack'commandshowthesenumber.Pushbehaviorwillchangeabitwithtopic.Whenpushingtoapublishingrepositorythechangesetswillturnpublicandthetopicdataonthemwillfadeaway.Thelogicregardingpushingnewheadswillbehavehasbefore,ignoreanytopicrelateddata.Whenpushingtoanon-publishingrepository(supportingtopic),theheadcheckingwillbedonetakingtopicdataintoaccount.Pushwillcomplainaboutmultipleheadsonabranchifyoupushmultipleheadswithnotopicinformationonthem(ormultiplepublicheads).Butpushinganewtopicwillnotrequiresanyspecificflag.However,pushingmultipleheadsonatopicwillbemetwiththeusualwarning.The'evolve'extensiontakes'topic'intoaccount.'hg evolve --all'willevolveallchangesetsintheactivetopic.Inaddition,bydefault.'hg next'and'hg prev'willsticktothecurrenttopic.Beawarethatthisextensionisstillanexperiment,commandsandotherfeaturesarelikelytobechange/adjusted/droppedovertimeaswerefinetheconcept.topic-mode==========Thetopicextensioncanbeconfiguredtoensuretheuserdonotforgettoaddatopicwhencommittinganewtopic:[experimental] # behavior when commit is made without an active topictopic-mode=ignore#donothingspecial(default)topic-mode=warning#printawarningtopic-mode=enforce#abortthecommit(exceptformerge)topic-mode=enforce-all#abortthecommit(evenformerge)topic-mode=random#usearandomizedgeneratedtopic(exceptformerge)topic-mode=random-all#usearandomizedgeneratedtopic(evenformerge)Singleheadenforcing=====================Theextensionscomewithanoptiontoenforcethatthereisonlyoneheadsforeachnameintherepositoryatanytime.[experimental]enforce-single-head=yesPublishingbehavior===================Topicvanishwhenchangesetmovetothepublicphases.Movingtothepublicphaseusuallyhappensonpush,butitispossibletoupdatethatbehavior.Theserverneedstohavespecificconfigforthis.*everythingpushedbecomepublic(thedefault):[phase]publish=yes*nothingpushturnedpublic:[phase]publish=no*topicbranchesarenotpublished,changesetwithouttopicare:[phase]publish=no[experimental]topic.publish-bare-branch=yesInaddition,thetopicextensionaddsa"--publish"flagon'hg push'.Whenused,thepushedrevisionsarepublishedifthepushsucceeds.Italsoappliestocommonrevisionsselectedbythepush.listofcommands:stacklistallchangesetsinatopicandotherinformationtopicsViewcurrenttopic,setcurrenttopic,changetopicforasetofrevisions,orseealltopics.(use'hg help -v topic'toshowbuilt-inaliasesandglobaloptions)$hghelptopicshgtopics[TOPIC]Viewcurrenttopic,setcurrenttopic,changetopicforasetofrevisions,orseealltopics.Cleartopiconexistingtopicedrevisions:hgtopics--rev<relatedrevset>--clearChangetopiconsomerevisions:hgtopics<newtopicname>--rev<relatedrevset>Clearcurrenttopic:hgtopics--clearSetcurrenttopic:hgtopics<topicname>Listoftopics:hgtopicsListoftopicssortedaccordingtotheirlasttouchedtimedisplayinglasttouchedtimeandtheuserwholasttouchedthetopic:hgtopics--ageTheactivetopic(ifany)willbeprependedwitha"*".The'--current'flaghelpstotakeactivetopicintoaccount.Forexample,ifyouwanttosetthetopiconallthedraftchangesetstotheactivetopic,youcando:'hg topics -r "draft()" --current'The--verboseversionofthiscommanddisplayvariousinformationonthestateofeachtopic.options([+]canberepeated):--clearclearactivetopicifany-r--revREV[+]revsetofexistingrevisions-l--listshowthestackofchangesetinthetopic--ageshowwhenyoulasttouchedthetopics--currentdisplaythecurrenttopiconly(somedetailshidden,use--verbosetoshowcompletehelp)$hgtopicsTesttopicsinteractionwithevolution:$hgtopics--configexperimental.evolution=$hgtopics--configexperimental.evolution=--rev.bobabort:musthaveobsoleteenabledtochangetopics[255]Createsomechanges:$forxinalphabetagammadelta;do>echofile$x>>$x>hgaddremove>hgci-m"Add file $x">doneaddingalphaaddingbetaaddinggammaaddingdeltaStillnotopics$hgtopics$hgtopics--currentnoactivetopic[1]$hgtopics--currentsomerandomtopicabort:cannotuse--currentwhensettingatopic[255]$hgtopics--current--clearabort:cannotuse--currentand--clear[255]$hgtopics--clearsomerandomtopicabort:cannotuse--clearwhensettingatopic[255]Tryingsomeinvalidtopicnames$hgtopic'.'abort:thename'.'isreserved[255]$hgtopicnullabort:thename'null'isreserved[255]$hgtopictipabort:thename'tip'isreserved[255]$hgtopic12345abort:cannotuseanintegerasaname[255]$hgtopic' 'abort:topicnamecannotconsistentirelyofwhitespaces[255]$hgtopic'a12#45'abort:invalidtopicname:'a12#45'(topicnamescanonlyconsistofalphanumeric,'-''_'and'.'characters)[255]$hgtopic'foo bar'abort:invalidtopicname:'foo bar'(topicnamescanonlyconsistofalphanumeric,'-''_'and'.'characters)[255]thisistryingtolisttopicnames$hgtopic''$hgtopic'*12 B23'abort:invalidtopicname:'*12 B23'(topicnamescanonlyconsistofalphanumeric,'-''_'and'.'characters)[255]Testcommitflagandhelptext$echostuff>>alpha$HGEDITOR=cathgci-ttopicflagHG:Entercommitmessage.Linesbeginningwith'HG:'areremoved.HG:Leavemessageemptytoabortcommit.HG:--HG:user:testHG:topic'topicflag'HG:branch'default'HG:changedalphaabort:emptycommitmessage[255]$hgrevertalpha$hgtopic*topicflag(0changesets)Makeatopic$hgtopicnarf$hgtopics*narf(0changesets)$hgtopics-v*narf(onbranch:default,0changesets)$hgstack ### topic: narf ### target: default (branch)(stackisempty)t0^Addfiledelta(basecurrent)Addcommitstotopic$echotopicwork>>alpha$hgci-m'start on narf'activetopic'narf'grewitsfirstchangeset(see'hg help topics'formoreinformation)$hgco.^1filesupdated,0filesmerged,0filesremoved,0filesunresolved$hgtopicfranmarkedworkingdirectoryastopic:fran$hgtopics*fran(0changesets)narf(1changesets)$hgtopics--currentfran$echo>>franwork>>beta$hgci-m'start on fran'activetopic'fran'grewitsfirstchangeset(see'hg help topics'formoreinformation)$hgconarfswitchingtotopicnarf2filesupdated,0filesmerged,0filesremoved,0filesunresolved$hgtopicfran(1changesets)*narf(1changesets)$hglog-r.-T'{topics}\n'narf$echo'narf!!!'>>alpha$hgci-m'narf!'$hglog-G@changeset:6:7c34953036d6|tag:tip|topic:narf|parent:4:fb147b0b417c|user:test|date:ThuJan0100:00:001970+0000|summary:narf!||ochangeset:5:0469d521db49||topic:fran||parent:3:a53952faf762||user:test||date:ThuJan0100:00:001970+0000||summary:startonfran||o|changeset:4:fb147b0b417c|/topic:narf|user:test|date:ThuJan0100:00:001970+0000|summary:startonnarf|ochangeset:3:a53952faf762|user:test|date:ThuJan0100:00:001970+0000|summary:Addfiledelta|ochangeset:2:15d1eb11d2fa|user:test|date:ThuJan0100:00:001970+0000|summary:Addfilegamma|ochangeset:1:c692ea2c9224|user:test|date:ThuJan0100:00:001970+0000|summary:Addfilebeta|ochangeset:0:c2b7d2f7d14buser:testdate:ThuJan0100:00:001970+0000summary:AddfilealphaExchangingoftopics:$cd..$hginitbrain$hg-Rpinkypush-r4brainpushingtobrainsearchingforchangesaddingchangesetsaddingmanifestsaddingfilechangesadded5changesetswith5changesto4filesExport$hg-Rpinkyexport # HG changeset patch # User test # Date 0 0 # Thu Jan 01 00:00:00 1970 +0000 # Node ID 7c34953036d6a36eae468c550d0592b89ee8bffc # Parent fb147b0b417c25ca15547cd945acf51cf8dcaf02 # EXP-Topic narfnarf!diff-rfb147b0b417c-r7c34953036d6alpha---a/alphaThuJan0100:00:001970+0000+++b/alphaThuJan0100:00:001970+0000@@-1,2+1,3@@filealphatopicwork+narf!!!Import$hg-Rpinkyexport>narf.diff$hg-Rpinky--configextensions.strip=strip.1filesupdated,0filesmerged,0filesremoved,0filesunresolvedsavedbackupbundleto$TESTTMP/pinky/.hg/strip-backup/7c34953036d6-1ff3bae2-backup.hg(glob)$hg-Rpinkyimportnarf.diffapplyingnarf.diff$hg-Rpinkylog-r.changeset:6:7c34953036d6tag:tiptopic:narfparent:4:fb147b0b417cuser:testdate:ThuJan0100:00:001970+0000summary:narf!Nowthatwe've pushed to brain, the work done on narf is no longer adraft, so we won'tseethattopicnameanymore:$hglog-Rpinky-G@changeset:6:7c34953036d6|tag:tip|topic:narf|parent:4:fb147b0b417c|user:test|date:ThuJan0100:00:001970+0000|summary:narf!||ochangeset:5:0469d521db49||topic:fran||parent:3:a53952faf762||user:test||date:ThuJan0100:00:001970+0000||summary:startonfran||o|changeset:4:fb147b0b417c|/user:test|date:ThuJan0100:00:001970+0000|summary:startonnarf|ochangeset:3:a53952faf762|user:test|date:ThuJan0100:00:001970+0000|summary:Addfiledelta|ochangeset:2:15d1eb11d2fa|user:test|date:ThuJan0100:00:001970+0000|summary:Addfilegamma|ochangeset:1:c692ea2c9224|user:test|date:ThuJan0100:00:001970+0000|summary:Addfilebeta|ochangeset:0:c2b7d2f7d14buser:testdate:ThuJan0100:00:001970+0000summary:Addfilealpha$cdbrain$hgcotip4filesupdated,0filesmerged,0filesremoved,0filesunresolvedBecausethechangeispublic,wewon't inherit the topic from narf. $ hg topic $ echo what >> alpha $ hg topic query marked working directory as topic: query $ hg ci -m 'whatisnarf,pinky?' active topic 'query' grew its first changeset (see 'hghelptopics' for more information) $ hg log -Gl2 @ changeset: 5:c01515cfc331 | tag: tip | topic: query | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: what is narf, pinky? | o changeset: 4:fb147b0b417c | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: start on narf | $ hg push -f ../pinky -r query pushing to ../pinky searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) $ hg -R ../pinky log -Gl 4 o changeset: 7:c01515cfc331 | tag: tip | topic: query | parent: 4:fb147b0b417c | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: what is narf, pinky? | | @ changeset: 6:7c34953036d6 |/ topic: narf | parent: 4:fb147b0b417c | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: narf! | | o changeset: 5:0469d521db49 | | topic: fran | | parent: 3:a53952faf762 | | user: test | | date: Thu Jan 01 00:00:00 1970 +0000 | | summary: start on fran | | o | changeset: 4:fb147b0b417c |/ user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: start on narf | $ hg topics * query (1 changesets) $ cd ../pinky $ hg co query switching to topic query 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo answer >> alpha $ hg ci -m 'Narfislike`zort`or`poit`!' $ hg merge narf merging alpha warning: conflicts while merging alpha! (edit, then use 'hgresolve--mark') 0 files updated, 0 files merged, 0 files removed, 1 files unresolved use 'hgresolve' to retry unresolved file merges or 'hgmerge--abort' to abandon [1] $ hg revert -r narf alpha $ hg resolve -m alpha (no more unresolved files) $ hg topic narf $ hg ci -m 'Finishnarf' $ hg topics fran (1 changesets) * narf (2 changesets) query (2 changesets) $ hg debugnamecomplete # branch:topic here is a buggy side effect default default:fran default:narf default:query fran narf query tip $ hg phase --public narf active topic 'narf' is now empty (use 'hgtopic--clear' to clear it if needed)POSSIBLE BUG: narf topic stays alive even though we just made allnarf commits public: $ hg topics fran (1 changesets) * narf (0 changesets) $ hg log -Gl 6 @ changeset: 9:ae074045b7a7 |\ tag: tip | | parent: 8:54c943c1c167 | | parent: 6:7c34953036d6 | | user: test | | date: Thu Jan 01 00:00:00 1970 +0000 | | summary: Finish narf | | | o changeset: 8:54c943c1c167 | | user: test | | date: Thu Jan 01 00:00:00 1970 +0000 | | summary: Narf is like `zort` or `poit`! | | | o changeset: 7:c01515cfc331 | | parent: 4:fb147b0b417c | | user: test | | date: Thu Jan 01 00:00:00 1970 +0000 | | summary: what is narf, pinky? | | o | changeset: 6:7c34953036d6 |/ parent: 4:fb147b0b417c | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: narf! | | o changeset: 5:0469d521db49 | | topic: fran | | parent: 3:a53952faf762 | | user: test | | date: Thu Jan 01 00:00:00 1970 +0000 | | summary: start on fran | | o | changeset: 4:fb147b0b417c |/ user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: start on narf | $ cd ../brain $ hg topics * query (1 changesets) $ hg pull ../pinky -r narf pulling from ../pinky abort: unknown revision 'narf'! [255] $ hg pull ../pinky -r default pulling from ../pinky searching for changes adding changesets adding manifests adding file changes added 3 changesets with 3 changes to 1 files new changesets 7c34953036d6:ae074045b7a7 1 local changesets published active topic 'query' is now empty (run 'hgupdate' to get a working copy) $ hg topics * query (0 changesets)We can pull in the draft-phase change and we get the new topic $ hg pull ../pinky pulling from ../pinky searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) new changesets 0469d521db49 (run 'hgheads' to see heads) $ hg topics fran (1 changesets) * query (0 changesets) $ hg log -Gr 'draft()' o changeset: 9:0469d521db49 | tag: tip | topic: fran | parent: 3:a53952faf762 | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: start on fran |query is not an open topic, so when we clear the current topic it'lldisappear:$hgtopics--clearclearingemptytopic"query"$hgtopicsfran(1changesets)Topicrevset$hglog-r'topic()'-Gochangeset:9:0469d521db49|tag:tip|topic:fran|parent:3:a53952faf762|user:test|date:ThuJan0100:00:001970+0000|summary:startonfran|$hglog-r'not topic()'-Gochangeset:8:ae074045b7a7|\ parent:7:54c943c1c167||parent:6:7c34953036d6||user:test||date:ThuJan0100:00:001970+0000||summary:Finishnarf|||ochangeset:7:54c943c1c167||parent:5:c01515cfc331||user:test||date:ThuJan0100:00:001970+0000||summary:Narfislike`zort`or`poit`!||o|changeset:6:7c34953036d6||parent:4:fb147b0b417c||user:test||date:ThuJan0100:00:001970+0000||summary:narf!|||@changeset:5:c01515cfc331|/user:test|date:ThuJan0100:00:001970+0000|summary:whatisnarf,pinky?|ochangeset:4:fb147b0b417c|user:test|date:ThuJan0100:00:001970+0000|summary:startonnarf|ochangeset:3:a53952faf762|user:test|date:ThuJan0100:00:001970+0000|summary:Addfiledelta|ochangeset:2:15d1eb11d2fa|user:test|date:ThuJan0100:00:001970+0000|summary:Addfilegamma|ochangeset:1:c692ea2c9224|user:test|date:ThuJan0100:00:001970+0000|summary:Addfilebeta|ochangeset:0:c2b7d2f7d14buser:testdate:ThuJan0100:00:001970+0000summary:AddfilealphaNomatchesbecausenarfisalreadyclosed:$hglog-r'topic(narf)'-GThisregexpshouldmatchthetopic`fran`:$hglog-r'topic("re:.ra.")'-Gochangeset:9:0469d521db49|tag:tip|topic:fran|parent:3:a53952faf762|user:test|date:ThuJan0100:00:001970+0000|summary:startonfran|Exactmatchonfran:$hglog-r'topic(fran)'-Gochangeset:9:0469d521db49|tag:tip|topic:fran|parent:3:a53952faf762|user:test|date:ThuJan0100:00:001970+0000|summary:startonfran|Matchcurrenttopic:$hgtopicfran(1changesets)$hglog-r'topic(.)'(nooutputisexpected)$hgcofranswitchingtotopicfran2filesupdated,0filesmerged,0filesremoved,0filesunresolved$hglog-r'topic(.)'changeset:9:0469d521db49tag:tiptopic:franparent:3:a53952faf762user:testdate:ThuJan0100:00:001970+0000summary:startonfranDeactivatethetopic.$hgtopics*fran(1changesets)$hgtopics--clear$echofran?>>beta$hgci-m'fran?'creatednewhead(considerusingtopicforlightweightbranches.See'hg help topic')$hglog-Gr'draft()'@changeset:10:4073470c35e1|tag:tip|user:test|date:ThuJan0100:00:001970+0000|summary:fran?|ochangeset:9:0469d521db49|topic:fran|parent:3:a53952faf762|user:test|date:ThuJan0100:00:001970+0000|summary:startonfran|$hgtopicsfran(1changesets)Testingforupdatingtot0==========================$hgupfranswitchingtotopicfran1filesupdated,0filesmerged,0filesremoved,0filesunresolved$hgstack ### topic: fran ### target: default (branch), ambiguous rebase destination - branch 'default' has 2 headst1@startonfran(current)t0^Addfiledelta(base)$hgupt0preservingthecurrenttopic'fran'1filesupdated,0filesmerged,0filesremoved,0filesunresolved$hgtopic*fran(1changesets)$hgstack ### topic: fran ### target: default (branch), ambiguous rebase destination - branch 'default' has 2 headst1:startonfrant0^Addfiledelta(basecurrent)$hgtopics--age*fran(1970-01-01bytest)$cd..Testingthenewconfigknobtoforbiduntopicedcommit======================================================$hginitponky$cdponky$cat<<EOF>>.hg/hgrc>[phases]>publish=false>EOF$cat<<EOF>>$HGRCPATH>[experimental]>topic-mode=enforce>EOF$touchabcd$hgadda$hgci-m"Added a"abort:noactivetopic(see'hg help -e topic.topic-mode'fordetails)[255](sametest,checkingweabortbeforetheeditor)$EDITOR=cathgci-m"Added a"--editabort:noactivetopic(see'hg help -e topic.topic-mode'fordetails)[255]$hgci-m"added a"--configexperimental.topic-mode=off$hglogchangeset:0:a154386e50d1tag:tipuser:testdate:ThuJan0100:00:001970+0000summary:addedaTestingthe--ageflagfor`hgtopics`======================================$hgtopictopic1970--rev0switchingtotopictopic1970changedtopicon1changes$hgaddb$hgtopictopic1990$hgci-m"Added b"--configdevel.default-date="631152000 0"--user"foo"activetopic'topic1990'grewitsfirstchangeset(see'hg help topics'formoreinformation)$hgaddc$hgtopictopic2010$hgci-m"Added c"--configdevel.default-date="1262304000 0"--user"bar"activetopic'topic2010'grewitsfirstchangeset(see'hg help topics'formoreinformation)$hglog-G@changeset:3:76b16af75125|tag:tip|topic:topic2010|user:bar|date:FriJan0100:00:002010+0000|summary:Addedc|ochangeset:2:bba5bde53608|topic:topic1990|user:foo|date:MonJan0100:00:001990+0000|summary:Addedb|ochangeset:1:e5a30a141954topic:topic1970parent:-1:000000000000user:testdate:ThuJan0100:00:001970+0000summary:addeda$hgtopicstopic1970(1changesets)topic1990(1changesets)*topic2010(1changesets)$hgtopics--age*topic2010(2010-01-01bybar)topic1990(1990-01-01byfoo)topic1970(1970-01-01bytest)$hguptopic1970switchingtotopictopic19700filesupdated,0filesmerged,2filesremoved,0filesunresolved$hgtopics--agetopic2010(2010-01-01bybar)topic1990(1990-01-01byfoo)*topic1970(1970-01-01bytest)$hgtopics--agerandomabort:cannotuse--agewhilesettingatopic[255]$cd..