hg-git support for topics?

32 views
Skip to first unread message

Malcolm Matalka

unread,
Mar 16, 2020, 11:51:25 AM3/16/20
to hg-git
Google searching hasn't provided me too much, but I'm wondering if
hg-git has support for topics? If not, is that because of lack of time
or is there some fundamental reason it doesn't match as well as
bookmarks? And if it is supported, how does one get it to work?

Thanks!

(I use hg-git literally everyday and it is a life saver for me, I really
appreciate all of the hard work people have put into it).

/Malcolm

Pierre-Yves David

unread,
Mar 16, 2020, 12:46:51 PM3/16/20
to hg-...@googlegroups.com, Malcolm Matalka, Manuel Jacob
We have been using hg-git with topic to develop Heptapod¹
(https://heptapod.net). I know that manuel started a series of patch to
cleanup an upstream that support in hg-git. I CCed him to this email, he
will be able to tell you more.

[1] (however, we are slowly phasing out hg-git usage in heptapod)
--
Pierre-Yves David

Manuel Jacob

unread,
Mar 16, 2020, 1:46:03 PM3/16/20
to hg-...@googlegroups.com, Malcolm Matalka
Hi Malcolm,

Here’s the patch series Pierre-Yves talked about:
https://foss.heptapod.net/mercurial/hg-git/merge_requests/8.
Documentation is sparse, but you can have a look at the test case. Keep
in mind that the mechanism is completely flexible and could be adapted
for topics. You could try the following configuration:

[git]
export-additional-refs.named-branch-heads:revset = head() and topic()
export-additional-refs.named-branch-heads:template = refs/heads/{topic}

It is required that each topic has only one head. Otherwise, multiple
git commits would have the same ref, which obviously doesn’t work.

Note that this works only in the hg->git direction. For two-way
synchronization, you would need to write some custom code in hg-git that
tags each changeset with the correct topic based on the git ref on the
head of the branch, but that would be brittle and can’t work in general.
Also, you’d probably want some mechanism to synthesize obsmarkers from
the git commits. Again, this would be brittle.

-Manuel

Malcolm Matalka

unread,
Mar 16, 2020, 2:57:03 PM3/16/20
to Pierre-Yves David, hg-...@googlegroups.com, Manuel Jacob

Pierre-Yves David <pierre-y...@ens-lyon.org> writes:

> We have been using hg-git with topic to develop Heptapod¹
> (https://heptapod.net). I know that manuel started a series of patch to cleanup
> an upstream that support in hg-git. I CCed him to this email, he will be able to
> tell you more.
>
> [1] (however, we are slowly phasing out hg-git usage in heptapod)

Are you moving to something else?
Reply all
Reply to author
Forward
0 new messages