[minimal example] (was: enforce-single-head = yes prevents commit, although there are no multiple heads)

Uwe Brauer oub at mat.ucm.es
Fri Dec 18 20:24:20 UTC 2020


>>> "UB" == Uwe Brauer <oub at mat.ucm.es> writes:

>>> "GR" == Georges Racinet <georges.racinet at octobus.net> writes:
>> On 12/17/20 8:46 AM, Uwe Brauer wrote:
>>> Hi
>>> 
>>> 
>>> I am not sure whether I will be able to produce a script that can
>>> reproduce the error described below because it occurs on a repository 
>>> with some 800 changesets and various branches
>>> 
>>> When I tried 
>>> 
>>> [experimental]
>>> enforce-single-head = yes
>> For the record, it is activated by default server-side in Heptapod [1].
>>> 
>>> On a small repository it did what I exspected, namely it prevented me by
>>> using say topics to create multiple heads on a branch.

>> This is already odd : with evolve and topic active, the "single head" is
>> assessed per branch/topic combination.

> I check this again and try to provide a minimal example.

Ok you are right here is what I did 

 hg init

Add to hgrc the option 

[experimental]
enforce-single-head = yes

echo "First" > test.org
hg add test.org
hg commit -u "Bernhard Riemann <bernhard.riemann at gmail.com>" -m "First"
hg topic FirstTopic
echo "Second" >> test.org
hg commit -u "Bernhard Riemann <bernhard.riemann at gmail.com>" -m "Second"
echo "Third" >> test.org
hg commit -u "Bernhard Riemann <bernhard.riemann at gmail.com>" -m "Third"
hg topics SecondTopic
echo "Forth" >> test.org
hg commit  -m "Fourth"
hg up FirstTopic
echo "Fifth" >> new.org
hg addremove
hg commit  -m "New head1"

hg log -G


@  changeset:   4:10b6a90ae25a
│  Branch:      default
│  tag:         tip
│  Author:      Uwe Brauer <oub at mat.ucm.es>
│  Date:        Fri, 18 Dec 2020 21:16:22 +0100
│  Topic:       FirstTopic
│  Phase:       draft
│  Summary:     New head1
│
│ ○  changeset:   3:05fb85498f2b
│╱   Branch:      default
│    Author:      Uwe Brauer <oub at mat.ucm.es>
│    Date:        Fri, 18 Dec 2020 21:13:13 +0100
│    Topic:       SecondTopic
│    Phase:       draft
│    Summary:     Fourth
│
○  changeset:   2:2789780c4252
│  Branch:      default
│  Author:      Bernhard Riemann <bernhard.riemann at gmail.com>
│  Date:        Fri, 18 Dec 2020 21:13:12 +0100
│  Topic:       FirstTopic
│  Phase:       draft
│  Summary:     Third
│
○  changeset:   1:09994738ad9f
│  Branch:      default
│  Author:      Bernhard Riemann <bernhard.riemann at gmail.com>
│  Date:        Fri, 18 Dec 2020 21:13:11 +0100
│  Topic:       FirstTopic
│  Phase:       draft
byte 1038                                


In my understanding this repository has 2 heads, but

The buggy hg heads shows one head.

hg log -r tip -T '{count(revset("head()"))}\n'

Shows three heads. Very confusing

So what is 

[experimental]
enforce-single-head = yes

Supposed to do?

regars
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5673 bytes
Desc: not available
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20201218/4610914b/attachment.p7s>


More information about the Mercurial mailing list