evolve: always create commit when resolving divergence
When resolving content-divergence, the final commit we create may end
up empty (which means that Mercurial won't even create it). We've had
code for handling that in evolve ever since 41bf6c27a122 (evolve:
stabilize now handle conflicting changeset, 2012-08-23). However, that
resolved the issue by marking on the divergent commits as
successor. As Pierre-Yves has pointed out (in other code reviews), we
should instead be creating a new successor. So that's what this patch
does. It does that by setting `ui.allowemptycommit` while creating the
final commit. However, that is not enough, because we may end up
creating the same nodeid as already existed (we'd then end up trying
to mark the "new" commit a successor of itself). To solve that, we add
some salt to the commit extras. That salt affects lots of tests.
=========================================Testingsingleheadenforcement:CaseA-2=========================================Arepositoryissettoonlyacceptasingleheadpername(typicallynamedbranch).However,obsoletechangesetscanmakethisenforcementmorecomplicated,becausetheycanbekeptvisiblebyotherchangesetonotherbranch.Thiscaseispartofaseriesoftestscheckingthisbehavior.CategoryA:InvolvingobsolescenceTestCase2:Abranchissplitintwo,effectivelycreatingtwoheads..old-state:....*2changesetchangesetonbranchdefault..*2changesetchangesetonbranchZontopofthem.....new-state:....*2changesetchangesetonbranchZatthesamelocation..*1changesetchangesetonbranchdefaultunchanged..*1changesetchangesetonbranchdefaultsuperceedingtheotherones....expected-result:....*twoheadsdetected....graph-summary:....D●(branchZ)..|..C●(branchZ)..|..Bø⇠◔B'.. | |.. A ● |.. |/.. ● $ . $TESTDIR/testlib/topic_setup.sh $ . $TESTDIR/testlib/push-checkheads-util.shTest setup---------- $ mkdir A2 $ cd A2 $ setuprepos single-head creating basic server and client repo updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd client $ mkcommit B0 $ hg branch Z marked working directory as branch Z (branches are permanent and global, did you want a bookmark?) $ mkcommit C0 $ mkcommit D0 $ hg push --new-branch pushing to $TESTTMP/A2/server searching for changes adding changesets adding manifests adding file changes added 3 changesets with 3 changes to 3 files $ hg up 0 0 files updated, 0 files merged, 4 files removed, 0 files unresolved $ mkcommit B1 created new head (consider using topic for lightweight branches. See 'hghelptopic') $ hg debugobsolete `getid "desc(B0)" ` `getid "desc(B1)"` 1 new obsolescence markers obsoleted 1 changesets 2 new orphan changesets $ hg log -G --hidden @ 25c56d33e4c4 [default] (draft): B1 | | * cdf1dbb37a67 [Z] (draft): D0 | | | * 3213e3e16c67 [Z] (draft): C0 | | | x d73caddc5533 [default] (draft): B0 | | | o 8aaa48160adc [default] (draft): A0 |/ o 1e4be0697311 [default] (public): rootActual testing--------------(force push to make sure we get the changeset on the remote) $ hg push -r 'desc("B1")' --force pushing to $TESTTMP/A2/server searching for changes adding changesets adding manifests adding file changes transaction abort! rollback completed abort: rejecting multiple heads on branch "default" (2 heads: 8aaa48160adc 25c56d33e4c4) [255]