topics: add a config to reject draft changeset without topic on a server
This patch adds a new config option experimental.topic-mode.server which if
sets to True, the server won't accept any draft changeset without topic on it.
In case both `experimental.topic-mode.server` and
`experimental.topic.publish-bare-branch` are set to True, the enforce-topic one
is respected.
Tests are added for it. The CHANGELOG file is also updated mentioning about the
config option.
$cat>>$HGRCPATH<<EOF>[extensions]>EOF$echo"evolve=$(echo $(dirname $TESTDIR))/hgext3rd/evolve/">>$HGRCPATHhgprev&nextmovetoparent/child$hginittest-repo$cdtest-repo$toucha$hgadda$hgcommit-m'added a'$touchb$hgaddb$hgcommit-m'added b'$hgprev0filesupdated,0filesmerged,1filesremoved,0filesunresolved[0]addeda$hgnext1filesupdated,0filesmerged,0filesremoved,0filesunresolved[1]addedbhgprev&nextrespect--quiet$hgprev-q$hgnext-qhgprev-Bshouldmoveactivebookmark$hgbookmarkmark$hgbookmarks*mark1:6e742c9127b3$hgprev-B0filesupdated,0filesmerged,1filesremoved,0filesunresolved[0]addeda$hgbookmarks*mark0:a154386e50d1hgnext-Bshouldmoveactivebookmark$hgnext-B--dry-runhgupdate1;hgbookmarkmark-r1;[1]addedb$hgnext-B1filesupdated,0filesmerged,0filesremoved,0filesunresolved[1]addedb$hgbookmarks*mark1:6e742c9127b3hgprevshouldunsetactivebookmark$hgprev--dry-runhgupdate0;[0]addeda$hgprev0filesupdated,0filesmerged,1filesremoved,0filesunresolved[0]addeda$hgbookmarksmark1:6e742c9127b3hgnextshouldmoveactivebookmark$hgbookmarkmark2$hgbookmarksmark1:6e742c9127b3*mark20:a154386e50d1$hgnext--dry-run--color=debughgupdate1;[[evolve.rev|1]]addedb$hgnext1filesupdated,0filesmerged,0filesremoved,0filesunresolved[1]addedb$hgbookmarksmark1:6e742c9127b3mark20:a154386e50d1$hgbookmark-dmark2$hgbookmarkmarkhgnext/prevshouldnotinterferewithinactivebookmarks$touchc$hgaddc$hgcommit-m'added c'$hgbookmark-r2no-move$hgprev-B0filesupdated,0filesmerged,1filesremoved,0filesunresolved[1]addedb$hgbookmarks*mark1:6e742c9127b3no-move2:4e26ef31f919$hgnext-B1filesupdated,0filesmerged,0filesremoved,0filesunresolved[2]addedc$hgbookmarks*mark2:4e26ef31f919no-move2:4e26ef31f919$hgup10filesupdated,0filesmerged,1filesremoved,0filesunresolved(leavingbookmarkmark)$hgnext-B1filesupdated,0filesmerged,0filesremoved,0filesunresolved[2]addedc$hgbookmarksmark2:4e26ef31f919no-move2:4e26ef31f919$hgprev-B0filesupdated,0filesmerged,1filesremoved,0filesunresolved[1]addedb$hgbookmarksmark2:4e26ef31f919no-move2:4e26ef31f919testprevonroot$hgupnull0filesupdated,0filesmerged,2filesremoved,0filesunresolved$hgprevalreadyatrepositoryroot[1]$hgup12filesupdated,0filesmerged,0filesremoved,0filesunresolvedBehaviorwithlocalmodification--------------------------------$echofoo>modified-bar$hgaddmodified-bar$hgprevabort:uncommittedchanges(doyouwant--merge?)[255]$hgprev--merge0filesupdated,0filesmerged,1filesremoved,0filesunresolved[0]addeda$hgnextabort:uncommittedchanges(doyouwant--merge?)[255]$hgnext--merge1filesupdated,0filesmerged,0filesremoved,0filesunresolved[1]addedbBehaviorwithaspiringchildren-------------------------------$hgrevert--allforgettingmodified-bar$hglog-Gochangeset:2:4e26ef31f919|bookmark:mark|bookmark:no-move|tag:tip|user:test|date:ThuJan0100:00:001970+0000|summary:addedc|@changeset:1:6e742c9127b3|user:test|date:ThuJan0100:00:001970+0000|summary:addedb|ochangeset:0:a154386e50d1user:testdate:ThuJan0100:00:001970+0000summary:addedanochildrenofanykind$hgnext1filesupdated,0filesmerged,0filesremoved,0filesunresolved[2]addedc$hgnextnochildren[1]$hgnext--evolvenochildren[1]$hgprev--dry-run--color=debughgupdate1;[[evolve.rev|1]]addedb$hgprev0filesupdated,0filesmerged,1filesremoved,0filesunresolved[1]addedbsomeaspiringchildren$hgamend-m'added b (2)'1neworphanchangesets$hgnextnochildren(1unstablechangesetstobeevolvedhere,doyouwant--evolve?)[1]$hgnext--evolve--dry-runmove:[2]addedcatop:[3]addedb(2)hgrebase-r4e26ef31f919-d9ad178109a19workingdirectorynowat9ad178109a19(addcoloroutputforsmoketesting)$hgnext--evolve--colordebugmove:[[evolve.rev|2]]addedcatop:[[evolve.rev|3]]addedb(2)[ui.status|workingdirectorynowat[evolve.node|e3b6d5df389b]]nextwithambiguity$hgprev0filesupdated,0filesmerged,1filesremoved,0filesunresolved[3]addedb(2)$echod>d$hgaddd$hgcommit-m'added d'creatednewhead$hgprev0filesupdated,0filesmerged,1filesremoved,0filesunresolved[3]addedb(2)$hgnextambiguousnextchangeset:[4]addedc[5]addeddexplicitlyupdatetooneofthem[1]nextwithambiguityinaspiringchildren$hgam-m'added b (3)'2neworphanchangesets$hgnextnochildren(2unstablechangesetstobeevolvedhere,doyouwant--evolve?)[1]$hgnext--evolveambiguousnext(unstable)changeset:[4]addedc[5]addedd(run'hg evolve --rev REV'ononeofthem)[1]$hgevolve-r5move:[5]addeddatop:[6]addedb(3)workingdirectoryisnowat47ea25be8aea$cd..prevandnextshouldlockproperlyagainstothercommands$hginitrepo$cdrepo$HGEDITOR=${TESTDIR}/fake-editor.sh$echohi>foo$hgci-Am'one'addingfoo$echobye>foo$hgci-Am'two'$hgamend--edit&$sleep1$hgprevwaitingforlockonworkingdirectoryof$TESTTMP/repoheldbyprocess'*'onhost'*'(glob)gotlockafter[4-6]seconds(re)1filesupdated,0filesmerged,0filesremoved,0filesunresolved[0]one$wait$hgamend--edit&$sleep1$hgnext--evolvewaitingforlockonworkingdirectoryof$TESTTMP/repoheldbyprocess'*'onhost'*'(glob)1neworphanchangesetsgotlockafter[4-6]seconds(re)move:[2]twoatop:[3]oneworkingdirectorynowata7d885c75614$wait