test-exchange-case-D3: avoid stripping obsolescence marker
The test needs to have changeset unknown locally with obsolescence markers still
applying to them. So we make sure the markers are not stripped (future 4.3 strip
markers by default).
$."$TESTDIR/testlib/topic_setup.sh"$hginitpinky$cdpinky$cat<<EOF>>.hg/hgrc>[phases]>publish=false>EOF$cat<<EOF>>$HGRCPATH>[experimental]>#disablethenewgraphstyleuntilwedrop3.7support>graphstyle.missing=|>EOF$hghelptopicshgtopics[TOPIC]Viewcurrenttopic,setcurrenttopic,orseealltopics.The--verboseversionofthiscommanddisplayvariousinformationonthestateofeachtopic.options:--clearclearactivetopicifany--changeVALUErevsetofexistingrevisionstochangetopic-l--listshowthestackofchangesetinthetopic(somedetailshidden,use--verbosetoshowcompletehelp)$hgtopicsTesttopicsinteractionwithevolution:$hgtopics--configexperimental.evolution=$hgtopics--configexperimental.evolution=--change.bobabort:musthaveobsoleteenabledtouse--change[255]Createsomechanges:$forxinalphabetagammadelta;do>echofile$x>>$x>hgaddremove>hgci-m"Add file $x">doneaddingalphaaddingbetaaddinggammaaddingdeltaStillnotopics$hgtopicsTestcommitflagandhelptext$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*topicflagMakeatopic$hgtopicnarf$hgtopics*narf$echotopicwork>>alpha$hgci-m'start on narf'$hgco.^1filesupdated,0filesmerged,0filesremoved,0filesunresolved$hgtopicfran$hgtopics*frannarf$echo>>franwork>>beta$hgci-m'start on fran'$hgconarfswitchingtotopicnarf2filesupdated,0filesmerged,0filesremoved,0filesunresolved$hgtopicfran*narf$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 $ hg ci -m 'whatisnarf,pinky?' $ 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 $ 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 'hgupdate-C.' 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 * narf query $ hg debugnamecomplete # branch:topic here is a buggy side effect default default:fran default:narf default:query fran narf query tip $ hg phase --public narfPOSSIBLE BUG: narf topic stays alive even though we just made allnarf commits public: $ hg topics fran * narf $ 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 $ 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 (run 'hgupdate' to get a working copy) $ hg topics * queryWe 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) (run 'hgheads' to see heads) $ hg topics fran * query $ 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--clear$hgtopicsfran--clearwhenwedon't have an active topic isn'tanerror:$hgtopics--clearTopicrevset$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$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$hgtopics--clear$echofran?>>beta$hgci-m'fran?'creatednewhead$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|$hgtopicsfranChangingtopicfailsifwedon't give a topic $ hg topic --change 9 abort: changing topic requires a topic name or --clear [255]Can'tchangetopicofapublicchange$hgtopic--change1::--clearabort:can't change topic of a public change [255]Can clear topics $ hg topic --change 9 --clear changed topic on 1 changes please run hg evolve --rev "not topic()" now $ hg log -Gr 'draft()andnotobsolete()' o changeset: 11:783930e1d79e | tag: tip | parent: 3:a53952faf762 | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: start on fran | | @ changeset: 10:4073470c35e1 | | user: test | | date: Thu Jan 01 00:00:00 1970 +0000 | | trouble: unstable | | summary: fran? | |Normally you'ddothiswithevolve,butwe'll use rebase to avoidbonus deps in the testsuite. $ hg rebase -d tip -s . rebasing 10:4073470c35e1 "fran?"Can add a topic to an existing change $ hg topic --change 11 wat changed topic on 1 changes please run hg evolve --rev "topic(wat)" now $ hg log -Gr 'draft()andnotobsolete()' o changeset: 13:d91cd8fd490e | tag: tip | topic: wat | parent: 3:a53952faf762 | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: start on fran | | @ changeset: 12:d9e32f4c4806 | | user: test | | date: Thu Jan 01 00:00:00 1970 +0000 | | trouble: unstable | | summary: fran? | |Normally you'ddothiswithevolve,butwe'll use rebase to avoidbonus deps in the testsuite. $ hg rebase -d tip -s . rebasing 12:d9e32f4c4806 "fran?" $ hg log -Gr 'draft()' @ changeset: 14:cf24ad8bbef5 | tag: tip | topic: wat | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: fran? | o changeset: 13:d91cd8fd490e | topic: wat | parent: 3:a53952faf762 | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: start on fran |Amend a topic $ hg topic watwat $ hg ci --amend $ hg log -Gr 'draft()' @ changeset: 16:893ffcf66c1f | tag: tip | topic: watwat | parent: 13:d91cd8fd490e | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: fran? | o changeset: 13:d91cd8fd490e | topic: wat | parent: 3:a53952faf762 | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: start on fran |Clear and amend: $ hg topic --clear $ hg ci --amend $ hg log -r . changeset: 18:a13639e22b65 tag: tip parent: 13:d91cd8fd490e user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: fran?Readding the same topic with topic --change should work: $ hg topic --change . watwat changed topic on 1 changes