In mercurial, is there an easy way to programmatically check out the 'latest' tag?
Meaning, if hg tags
produces this:
tip
Tag3
Tag2
Tag1
Is there an easy way to checkout Tag 3 in a generic way? Meaning, not just hg checkout Tag3
, but a generic way of doing so.
EDIT: If I must use scripting, I can. However, I'm stuck on windows and would like to avoid scripting if possible.
You can use "hg tag" command with an option -l or --local. This will store the tag in the file . hg/localtags, which will not be distributed or versioned.
hg graft has additional functionality over and above simple cherry picking of one revision. For example, you can graft a range of revisions onto another branch.
hg status shows the status of a repository. Files are stored in a project's working directory (which users see), and the local repository (where committed snapshots are permanently recorded). hg add tells Mercurial to track files. hg commit creates a snapshot of the changes to 1 or more files in the local repository.
If you want to remove a tag that you no longer want, use hg tag --remove . You can also modify a tag at any time, so that it identifies a different revision, by simply issuing a new hg tag command.
You can do it with revsets. Probably something like this:
hg update -r 'max(tagged())'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With