Support full mercurial templates in changeset.link
Created originally on Bitbucket by muxator
TortoiseHg can generate an hyperlink to an online version of a changeset via changeset.link
in hgrc
.
Current situation as of TortoiseHg 4.9
The "template string" uses a "mercurial template"-like syntax that accepts only two hardcoded template expressions:
-
{node|short}
: replaced by the 12 digit revision id (note that{node}
on its own is currently unsupported) -
{rev}
: replaced by the revision number
Proposal
Allow use of complete mercurial templates syntax in changeset.link
, getting rid of the hardcoded solution.
Benefit to TortoiseHg
It will be possible to generate the link extracting every possible information from a commit. For example, for repositories that are cloned via hg-git, it will be possible to generate direct links to commits on GitHub or GitLab:
- GitHub:
https://github.com/torvalds/linux/commit/{gitnode}
- GitLab:
https://gitlab.com/tortoisegit/tortoisegit/commit/{gitnode}
Where is the code?
The code depends on closing #5374 (closed) (for which a proposal has been submitted on the mailing list). On top of that, a short series will implement this feature (also sent to the mailing list for review).