topics vs bookmarks and hg-git

Manuel Jacob me at manueljacob.de
Wed Jul 29 08:51:16 UTC 2020


On 2020-07-29 09:03, Uwe Brauer wrote:
>>>> "MJ" == Manuel Jacob <me at manueljacob.de> writes:
> 
>    > Bookmarks work best with hg-git, as they can be easily mapped to 
> Git
>    > refs and back.
> 
> 
>    > The following configuration will export all topic heads to Git
>    > branches with the name of the topic:
> 
>    > [git]
>    > export-additional-refs.named-branch-heads:revset = head() and 
> topic()
>    > export-additional-refs.named-branch-heads:template = 
> refs/heads/{topic}
> 
> 
> 
> 
>    > With this configuration, if you push from Mercurial to Git and 
> then
>    > pull from Git to Mercurial, all the topic heads will have a 
> bookmark
>    > with the name of the topic, which is a mess of course. You could 
> work
>    > around that by modifying the template to give them a different Git 
> ref
>    > to avoid the naming clash, or add a hook removing the bookmarks, 
> but
>    > then you won’t see if the Git side was updated.
> 
> I am one of the hg-git users, who uses topics and named branches and 
> has
> to deal with git repositories.
> 
> 
> I find the following configuration more useful (tested in bitbucket,
> where everybody
> used mercurial+hg-git and tested in sourceforge, where everybody 
> besides
> me uses git). In the above configuration git users will see a git 
> branch
> called default, which they might find confusing.

That doesn’t happen with the above configuration, as only heads with 
some topic are considered and the branch name doesn’t appear in the 
template.

But when including the branch name in the template, you may want to 
exclude it in the revset and add another revset/template pair to map the 
default branch to "master" / "main" / something else.

> export-additional-refs.named-branch-heads:revset   = head() and not
> branch('re:\Adefault\Z')
> export-additional-refs.named-branch-heads:template = 
> refs/heads/{branch}|{topic}
> 
> As Manual said, the problem is pulling from new commits of git users,
> you will obtain bookmarks with the same name as the topics/named_branch
> 
> Uwe Brauer
> 
>    > On 2020-07-29 01:14, Ernie Rael wrote:
>    >> Can (should) I use topics, instead of bookmarks, with hg-git and
>    >> github?
>    >> -ernie
>    >> _______________________________________________
>    >> Mercurial mailing list
>    >> Mercurial at mercurial-scm.org
>    >> https://www.mercurial-scm.org/mailman/listinfo/mercurial
>    > _______________________________________________
>    > Mercurial mailing list
>    > Mercurial at mercurial-scm.org
>    > https://www.mercurial-scm.org/mailman/listinfo/mercurial
> 
> 
> _______________________________________________
> Mercurial mailing list
> Mercurial at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial



More information about the Mercurial mailing list