git-cinnabar icon indicating copy to clipboard operation
git-cinnabar copied to clipboard

Add support for tracking topics as remote refs.

Open riastradh opened this issue 2 weeks ago • 1 comments

NOTE: New tests will require the hg-evolve extension to be installed and available. This change does not yet update the CI logic to make that happen, so I expect the new tests will fail until it is updated.

Like Mercurial branches, Mercurial topics are labels in the metadata of a changeset. While branches are meant for long-term history, topics are meant for short-term work-in-progress, like git feature branches for github pull requests. Once a topic is made public, the topic name is hidden by default. Each topic is associated with a branch; the fully-qualified name is written <branch>//<topic> when the branch is not implied.

This adds a new option 'topics' to the cinnabar.refs knob to expose topic T of branch B as any of

  • refs/heads/topics/<B>/<T>
  • refs/heads/topics/<B>/<T>/tip
  • refs/heads/topics/<B>/<T>/<SHA1>

depending on whether 'tips' or 'heads' is included too. When cinnabar.refs has 'topics' included, branch heads and bookmarks are also exposed under 'refs/heads/branches/...' and 'refs/heads/bookmarks/...' too like with certain other combinations of options.

Topics are detected using essentially the same method by which branches are detected. Once a topic is published, the corresponding refs/heads/topics/* refs will vanish.

When the remote hg server advertises support with the 'topics-namespaces' extension, use the 'branchmaptns' rather than 'branchmap' cmd to query the remote heads so we can distinguish between topics and branches.

By default, cinnabar.refs does not have 'topics' included, so there is no change to the semantics.

fix https://github.com/glandium/git-cinnabar/issues/326

riastradh avatar Dec 08 '25 04:12 riastradh

No Taskcluster jobs started for this pull request

The allowPullRequests configuration for this repository (in .taskcluster.yml on the default branch) does not allow starting tasks for this pull request.