2

I want to get a list of all the bookmarks in a Mercurial repository with the "freshest" bookmarks at the top, where the "freshest" bookmark is the one that I've hg update'd to most recently (and is, therefore, more likely to be one I want to pay attention to).

Is there a way I can use Mercurial to either (a) sort the list of bookmarks by latest commit, or (b) get a list of bookmarks together with each one's last-commit date, in some kind of machine-readable format?

This Stack Overflow post offers an excellent way to do this with Git, but doesn't help me for Mercurial.

Community
  • 1
  • 1

1 Answers1

2

Stackoverflow may not know yet, but sure does the integrated mercurial help, especially if you ask it about revsets hg help revsets. Then it's a piece of cake to try

hg log -r "sort(bookmark())"

If you need anything else than standard output ask mercurial help on templating (hg help templates). E.g. try

hg log -r "sort(bookmark())" -T "{bookmark} {node|short} {date|isodate} {author}:\n{desc|firstline}"
planetmaker
  • 5,884
  • 3
  • 28
  • 37