Reputation: 13048
TortoiseHG lets you add custom toolbar tools that can run mercurial (or any other) commands.
These tools would be many times more useful if it is possible to integrate them better into THG by passing them arguments from THG itself. For instance, pass a command the list of files you have selected in the working directory view.
I have seen a small handful of examples of doing this but I can't find any comprehensive documentation on what params are available, etc.
Checking the TortoiseHG documentation, it actually doesn't even list the custom tools topic at all (seems to be quite out of date).
Pressing F1 in THG doesn't do anything either... and web searches have not turned up anything.
Upvotes: 1
Views: 163
Reputation: 13048
Eventually I just looked at the THG source code and I've listed below the variables which you can pass from THG to your custom commands. In doing that I also realized that the custom tool window tooltips show the same information! So its been there all along, just not noticed (by me).
Here's what the source code has to say:
You can use several
{VARIABLES}
to compose your command.Common variables:
{ROOT}
: The path to the current repository root.
{REV}
/{REVID}
: Selected revisions numbers / hexadecimal' revision id hashes respectively formatted as a revset' expression.
{SELECTEDFILES}
: The list of files selected by the user on the ' revision details file list.
{FILES}
: The list of files touched by the selected revisions.
{ALLFILES}
: All the files tracked by Mercurial on the selected' revisions.Pair selection variables:
{REV_A}
/{REVID_A}
: the first selected revision number / ' hexadecimal revision id hash respectively.
{REV_B}
/{REVID_B}
: the second selected revision number / ' hexadecimal revision id hash respectively.
And here's where the tooltip makes itself known:
Note that aside from the Command
input, it also seems that you can use the same variables in the Working Directory
input.
Upvotes: 1