Search code examples
mercurialbranch

How to tell if a name is a tag, bookmark, or named branch?


Given a nice string labe that works with hg show (ex: hg show stable), how can I determine if stable is a tag name, a bookmark name, or a named branch?


Solution

    1. In core hg, hg show will show nothing about repository, because
    • "show" command is shorthand for "showconfig", which, in turn, is alias for "config"
    • hg config is used for

    show combined config settings from all hgrc files

    only

    1. If you have any id, related to some unknown changeset in repository, you can always get full details about this changeset, using ordinary hg log -r <ID> even with default template

    Id is tag

    >hg log -r 0.2.4
    changeset:   358:b53421918a89
    tag:         0.2.4
    ...
    

    Id is bookmark

    >hg log -r mainline
    changeset:   1195:b800644fcbe2
    bookmark:    mainline
    …
    

    The same results will appear for topics|branches, I just haven't samples now