stablerange: introduce a smarte version of stablerange for 'mergepoint'
This implementation will using caching and smarter algorithm based on these
cache. For now it inherit most of it code from the dummy version for
convenience. The inheritance to the dummy version should be dropped eventually.
Testsforchangingandclearingtopics======================================$."$TESTDIR/testlib/topic_setup.sh"$cat<<EOF>>$HGRCPATH>[experimental]>#disablethenewgraphstyleuntilwedrop3.7support>graphstyle.missing=|>evolution=createmarkers,allowunstable>[phases]>publish=false>[alias]>glog=log-G-T"{rev}:{node|short} \{{topics}}\n{desc} ({bookmarks})\n\n">EOFAbouttheglogoutput:{}containsthetopicnameand()willcontainthebookmarkSettinguparepo----------------$hginittopics$cdtopics$forchinabcdefgh;dotouch$ch;echo"foo">>$ch;hgci-Aqm"Added "$ch;done$hgglog@7:ec2426147f0e{}|Addedh()|o6:87d6d6676308{}|Addedg()|o5:825660c69f0c{}|Addedf()|o4:aa98ab95a928{}|Addede()|o3:62615734edd5{}|Addedd()|o2:28ad74487de9{}|Addedc()|o1:29becc82797a{}|Addedb()|o0:18d04c59bb5d{}Addeda()Clearingtopicfromrevisionwithouttopic$hgtopic-r.--clearchangedtopicon0changesClearingcurrenttopicwhennoactivetopicisnoterror$hgtopic$hgtopic--clearSettingtopicstoalltherevisions$hgtopic-r0::fooswitchingtotopicfoochangedtopicon8changes$hgglog@15:05095f607171{foo}|Addedh()|o14:97505b53ab0d{foo}|Addedg()|o13:75a8360fe626{foo}|Addedf()|o12:abcedffeae90{foo}|Addede()|o11:1315a3808ed0{foo}|Addedd()|o10:1fa891977a22{foo}|Addedc()|o9:a53ba98dd6b8{foo}|Addedb()|o8:86a186070af2{foo}Addeda()Clearingtheactivetopicusing--clear$hgtopic*foo(8changesets)$hgtopic--clear$hgtopicfoo(8changesets)Changingtopicsonsomerevisions(alsotestingissue5441)$hgtopic-r12::barswitchingtotopicbarchangedtopicon4changes$hgglog@19:d7d36e193ea7{bar}|Addedh()|o18:e7b418d79a05{bar}|Addedg()|o17:82e0b14f4d9e{bar}|Addedf()|o16:edc4a6b9ea60{bar}|Addede()|o11:1315a3808ed0{foo}|Addedd()|o10:1fa891977a22{foo}|Addedc()|o9:a53ba98dd6b8{foo}|Addedb()|o8:86a186070af2{foo}Addeda()Changingtopicswithoutpassingtopicnameandclear$hgtopic-r.abort:changingtopicrequiresatopicnameor--clear[255]Changingtopicusing--currentflag$hgtopicfoobar$hgtopic-r.--currentactivetopic'foobar'grewitsfirstchangesetchangedtopicon1changes$hgglog-r.@20:c2d6b7df5dcf{foobar}|Addedh()|Changingtopicinbetweenthestack$hgtopic-r9::10--currentchangedtopicon2changes$hgglogo22:1b88140feefe{foobar}|Addedc()|o21:c39cabfcbbf7{foobar}|Addedb()||@20:c2d6b7df5dcf{foobar}||Addedh()|||o18:e7b418d79a05{bar}||Addedg()|||o17:82e0b14f4d9e{bar}||Addedf()|||o16:edc4a6b9ea60{bar}||Addede()|||o11:1315a3808ed0{foo}||Addedd()|||x10:1fa891977a22{foo}||Addedc()|||x9:a53ba98dd6b8{foo}|/Addedb()|o8:86a186070af2{foo}Addeda()$hgrebase-s11-d22rebasing11:1315a3808ed0"Added d"(foo)switchingtotopicfoorebasing16:edc4a6b9ea60"Added e"(bar)switchingtotopicbarrebasing17:82e0b14f4d9e"Added f"(bar)rebasing18:e7b418d79a05"Added g"(bar)rebasing20:c2d6b7df5dcf"Added h"(foobar)switchingtotopicfoobar$hgglog@27:a1a9465da59b{foobar}|Addedh()|o26:7c76c271395f{bar}|Addedg()|o25:7f26084dfaf1{bar}|Addedf()|o24:b1f05e9ba0b5{bar}|Addede()|o23:f9869da2286e{foo}|Addedd()|o22:1b88140feefe{foobar}|Addedc()|o21:c39cabfcbbf7{foobar}|Addedb()|o8:86a186070af2{foo}Addeda()Amendingatopic----------------Whenthechangesethasatopicandwehavedifferentactivetopic$hgtopicwat$hgci--amendactivetopic'wat'grewitsfirstchangeset$hgglog-r.@28:61470c956807{wat}|Addedh()|Clearthecurrenttopicandamending$hgtopic--clear$hgci--amend$hgglog-r.@29:b584fa49f42e{}|Addedh()|Whenthechangesetdoesnothasatopicbutwehaveanactivetopic$hgtopicwatwatmarkedworkingdirectoryastopic:watwat$hgci--amendactivetopic'watwat'grewitsfirstchangeset$hgglog-r.@30:a24c31c35013{watwat}|Addedh()|Testingchangingtopicsonpublicchangeset-------------------------------------------$hgphase-r8-pClearingthetopic$hgtopic-r8--clearabort:can't change topic of a public change [255]Changing the topic $ hg topic -r 8 foobarboo abort: can'tchangetopicofapublicchange[255]Testingthebookmarkmovement-----------------------------$hgbookmarkbook$hgglog@30:a24c31c35013{watwat}|Addedh(book)|o26:7c76c271395f{bar}|Addedg()|o25:7f26084dfaf1{bar}|Addedf()|o24:b1f05e9ba0b5{bar}|Addede()|o23:f9869da2286e{foo}|Addedd()|o22:1b88140feefe{foobar}|Addedc()|o21:c39cabfcbbf7{foobar}|Addedb()|o8:86a186070af2{}Addeda()Onclearingthetopic$hgtopic-r.--clearclearingemptytopic"watwat"activetopic'watwat'isnowemptychangedtopicon1changes$hgglog@31:c48d6d71b2d9{}|Addedh(book)|o26:7c76c271395f{bar}|Addedg()|o25:7f26084dfaf1{bar}|Addedf()|o24:b1f05e9ba0b5{bar}|Addede()|o23:f9869da2286e{foo}|Addedd()|o22:1b88140feefe{foobar}|Addedc()|o21:c39cabfcbbf7{foobar}|Addedb()|o8:86a186070af2{}Addeda()Onchangingthetopic$hgbookmarkbookboo$hgtopic-r.movebookswitchingtotopicmovebookchangedtopicon1changes$hgglog@32:1b83d11095b9{movebook}|Addedh(bookbookboo)|o26:7c76c271395f{bar}|Addedg()|o25:7f26084dfaf1{bar}|Addedf()|o24:b1f05e9ba0b5{bar}|Addede()|o23:f9869da2286e{foo}|Addedd()|o22:1b88140feefe{foobar}|Addedc()|o21:c39cabfcbbf7{foobar}|Addedb()|o8:86a186070af2{}Addeda()Changingtopiconsecretchangesets-----------------------------------$hgup26switchingtotopicbar0filesupdated,0filesmerged,1filesremoved,0filesunresolved(leavingbookmarkbookboo)$hgphase-r.-s-f$hgphase-r.26:secret$hgtopic-r.watwatswitchingtotopicwatwatchangedtopicon1changes$hgglog@33:894983f69e69{watwat}|Addedg()||o32:1b83d11095b9{movebook}||Addedh(bookbookboo)|||x26:7c76c271395f{bar}|/Addedg()|o25:7f26084dfaf1{bar}|Addedf()|o24:b1f05e9ba0b5{bar}|Addede()|o23:f9869da2286e{foo}|Addedd()|o22:1b88140feefe{foobar}|Addedc()|o21:c39cabfcbbf7{foobar}|Addedb()|o8:86a186070af2{}Addeda()$hgphase-r.33:secret