enforce-single-head = yes its implications (push is *not* completely aborted)

Uwe Brauer oub at mat.ucm.es
Thu Nov 19 15:48:10 UTC 2020



Hi

I just added 
[experimental]
enforce-single-head = yes

And also 

[phases]
publish = True


To my global .hgrc and run the following experiment



hg init
echo "First" > test.org
hg add test.org
hg commit -u "Bernhard Riemann <bernhard.riemann at gmail.com>" -m "First"
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"
echo "Forth" >> test.org
hg commit  -m "Fourth"
hg up 1
hg topics NewTopic
echo "Fifth" >> new.org
hg addremove
hg commit  -m "New head1"
echo "Six" >> new.org
hg commit  -m "New head2"

Now the default branch has *two* heads one of the heads has a topic though. 

I create a new repository in helix and I push. 


http authorization required for https://helixteamhub.cloud/tiny-butterfly-778/projects/test-topic/repositories/mercurial/test-topic
realm: Helix TeamHub Mercurial repository

searching for changes
abort: empty revision on one side of range
warning: outgoing hook exited with status 255
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 6 changesets with 7 changes to 3 files (+1 heads)
abort: 2 heads on "default"
(db989fbe5943, d3b44678b0d1)

But some part of the repository went through but the changesets which
belong to the head without a topic name were not pushed.



So I tried to clone in a temporary directory

hg clone https://oubucmes@helixteamhub.cloud/tiny-butterfly-778/projects/test-topic/repositories/mercurial/test-topic
http authorization required for https://helixteamhub.cloud/tiny-butterfly-778/projects/test-topic/repositories/mercurial/test-topic
realm: Helix TeamHub Mercurial repository
user: oubucmes
password:
destination directory: test-topic
requesting all changes
adding changesets
adding manifests
adding file changes
transaction abort!
rollback completed
abort: 2 heads on "default"
(db989fbe5943, d3b44678b0d1)

Now its get funny I comment the 

# enforce-single-head = yes


And clone again well both heads are there.

Conclusion:

I find the push problematic, I think mercurial should have aborted the
push all together may be even with the message «merge your heads»


Any thoughts?
Most likely I did misunderstand something but what

Regards

Uwe Brauer 



More information about the Mercurial mailing list