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.
====================================Testingheadcheckingcode:CaseD-1====================================Mercurialchecksfortheintroductionofnewheadsonpush.Evolutioncomesintoplaytodetectifexistingbranchesontheserverarebeingreplacedbysomeofthenewonewepush.Thiscaseispartofaseriesoftestscheckingthisbehavior.CategoryD:remoteheadis"obs-affected"locally,butresultisnotpartofthepushTestCase1:remoteheadisrewritten,butsuccessorsisnotpartofthepush..old-state:....*1changesetbranch....new-state:....*1changesetbranchsucceedingtheoldbranch..*1newunrelatedbranch....expected-result:....*pushingonlytheunrelatedbranch:denied....graph-summary:....Aø⇠○A'.. |/.. | ◔ B.. |/.. ● $ . $TESTDIR/testlib/push-checkheads-util.shTest setup---------- $ mkdir D1 $ cd D1 $ setuprepos creating basic server and client repo updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd client $ hg up 0 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ mkcommit A1 created new head $ hg debugobsolete `getid "desc(A0)" ` `getid "desc(A1)"` obsoleted 1 changesets $ hg up 0 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ mkcommit B0 created new head $ hg log -G --hidden @ 74ff5441d343 (draft): B0 | | o f6082bc4ffef (draft): A1 |/ | x 8aaa48160adc (draft): A0 |/ o 1e4be0697311 (public): rootActual testing-------------- $ hg push -r 'desc(B0)' pushing to $TESTTMP/D1/server (glob) searching for changes abort: push creates new remote head 74ff5441d343! (merge or see 'hghelppush' for details about pushing new heads) [255] $ cd ../..