obsolete: add debugsuccessors command
It dumps obsolete changesets and their successors.
$cat>>$HGRCPATH<<EOF>[defaults]>amend=-d"0 0">[web]>push_ssl=false>allow_push=*>[phases]>publish=False>[alias]>qlog=log--template='{rev} - {node|short}{desc} ({phase})\n'>[diff]>git=1>unified=0>[extensions]>hgext.rebase=>hgext.graphlog=>EOF$echo"obsolete=$(echo $(dirname $TESTDIR))/hgext/obsolete.py">>$HGRCPATH$echo"evolve=$(echo $(dirname $TESTDIR))/hgext/evolve.py">>$HGRCPATH$mkcommit(){>echo"$1">"$1">hgadd"$1">hgci-m"add $1">}variousinit$hginitlocal$cdlocal$mkcommita$mkcommitb$cat>>.hg/hgrc<<EOF>[phases]>publish=True>EOF$hgpull-q.#make1public$rm.hg/hgrc$mkcommitc$mkcommitd$hgup10filesupdated,0filesmerged,2filesremoved,0filesunresolved$mkcommite-qcreatednewhead$mkcommitf$hgqlog5-e44648563c73addf(draft)4-fbb94e3a0ecfadde(draft)3-47d2a3944de8addd(draft)2-4538525df7e2addc(draft)1-7c3bad9141dcaddb(public)0-1f0dee641bb7adda(public)testsimplekill$hgkill50filesupdated,0filesmerged,1filesremoved,0filesunresolvedworkingdirectorynowatfbb94e3a0ecf$hgqlog4-fbb94e3a0ecfadde(draft)3-47d2a3944de8addd(draft)2-4538525df7e2addc(draft)1-7c3bad9141dcaddb(public)0-1f0dee641bb7adda(public)testmultiplekill$hgkill430filesupdated,0filesmerged,1filesremoved,0filesunresolvedworkingdirectorynowat7c3bad9141dc$hgqlog2-4538525df7e2addc(draft)1-7c3bad9141dcaddb(public)0-1f0dee641bb7adda(public)$cd..##########################importingParrentest##########################$cat<<EOF>>$HGRCPATH>[ui]>logtemplate="{rev}\t{bookmarks}: {desc|firstline} - {author|user}\n">EOFCreatingAndUpdatingChangeset===============================SetuptheBaseRepo-------------------Westartwithaplainbaserepo::$hginitmain;cdmain$cat>main-file-1<<-EOF>One>>Two>>Three>EOF$echoTwo>main-file-2$hgaddaddingmain-file-1addingmain-file-2$hgcommit--messagebase$cd..andclonethisintoanewrepowherewedoourwork::$hgclonemainworkupdatingtobranchdefault2filesupdated,0filesmerged,0filesremoved,0filesunresolved$cdworkCreateFirstPatch------------------Tobeginwith,wejustdothechangesthatwillbetheinitialversionofthechangeset::$echoOne>file-from-A$sed-i''-es/One/Eins/main-file-1$hgaddfile-from-ASothisiswhatwewouldlikeourchangesettobe::$hgdiffdiff--gita/file-from-Ab/file-from-Anewfilemode100644---/dev/null+++b/file-from-A@@-0,0+1,1@@+Onediff--gita/main-file-1b/main-file-1---a/main-file-1+++b/main-file-1@@-1,1+1,1@@-One+EinsTocommititwejust-commitit::$hgcommit--message"a nifty feature"andplaceabookmarksowecaneasilyrefertoitagain(whichwecouldhavedonebeforethecommit)::$hgbookfeature-ACreateSecondPatch-------------------Let's do this again for the second changeset:: $ echo Two >file-from-B $ sed -i'' -e s/Two/Zwie/ main-file-1 $ hg add file-from-BBefore committing, however, we need to switch to a new bookmark for the secondchangeset. Otherwise we would inadvertently move the bookmark for our first changeset.It is therefore advisable to always set the bookmark before committing:: $ hg book feature-B $ hg commit --message "another feature"So here we are:: $ hg book feature-A 1:568a468b60fc * feature-B 2:7b36850622b2Fix The Second Patch--------------------There'satypoinfeature-B.Wespelled*Zwie*insteadof*Zwei*::$hgdiff--changetip|grep-FZwie+ZwieFixingthisisveryeasy.Justchange::$sed-i''-es/Zwie/Zwei/main-file-1and**amend**::$hgamend--note"fix spelling of Zwei"The`--note`isourcommitmessageforthe*update*only.Soitsonlypurposeistodocumenttheevolutionofthechangeset.Ifweuse`--message`with`amend`,itreplacesthecommitmessageofthechangesetitself.Thisresultsinanewsinglechangesetforouramendedchangeset,andtheoldchangesetplustheupdatingchangesetarehiddenfromviewbydefault::$hglog4feature-B:anotherfeature-test1feature-A:aniftyfeature-test0:base-test$hgupfeature-A-q$hgbookmark-ifeature-A$sed-i''-es/Eins/Un/main-file-1$hgamend--note'french looks better'1newunstableschangesets$hglog6feature-A:aniftyfeature-test4feature-B:anotherfeature-test1:aniftyfeature-test0:base-test$hgup-q1Workingdirectoryparentisobsolete$hgstabilizemove:[4]anotherfeatureatop:[6]aniftyfeaturemergingmain-file-1$hglog7feature-B:anotherfeature-test6feature-A:aniftyfeature-test0:base-testTestcommit-ooptions$hgup61filesupdated,0filesmerged,1filesremoved,0filesunresolved$hgrevert-r7--alladdingfile-from-Brevertingmain-file-1$sed-i''-es/Zwei/deux/main-file-1$hgcommit-m'another feature that rox'-o7creatednewhead$hglog8feature-B:anotherfeaturethatrox-test6feature-A:aniftyfeature-test0:base-test$cd..enablegeneraldelta$cat<<EOF>>$HGRCPATH>[format]>generaldelta=1>EOF$hginitalpha$cdalpha$echo'base'>firstfile$hgaddfirstfile$hgci-m'base'$cd..$hgclone-Ur0alphabetaaddingchangesetsaddingmanifestsaddingfilechangesadded1changesetswith1changesto1files$cdalpha$cat<<EOF>A>We>need>some>kind>of>file>big>enough>to>prevent>snapshot>.>yes>new>lines>are>useless>.>EOF$hgaddA$hgcommit-m'adding A'$hgmvAB$echo'.'>>B$hgamend-m'add B'$hgverifycheckingchangesetscheckingmanifestscrosscheckingfilesinchangesetsandmanifestscheckingfiles3files,4changesets,4totalrevisions$hg--configextensions.hgext.mq=strip'extinct()'savedbackupbundleto$TESTTMP/alpha/.hg/strip-backup/e87767087a57-backup.hg$hgverifycheckingchangesetscheckingmanifestscrosscheckingfilesinchangesetsandmanifestscheckingfiles2files,2changesets,2totalrevisions$cd..Clonejustthisbranch$cdbeta$hgpull-rtip../alphapullingfrom../alphasearchingforchangesaddingchangesetsaddingmanifestsaddingfilechangesadded1changesetswith1changesto1files(run'hg update'togetaworkingcopy)$hgup2filesupdated,0filesmerged,0filesremoved,0filesunresolved