Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mercurial - listing a user's heads

Tags:

mercurial

Is there a way to list heads that were created by a specific user?

With the hg heads command I am unable to filter on user.

While with hg log I can filter on a user, but am unable to figure out how to list only the last changeset on a branch.

UPDATE:

Thanks to Tim Henigan's answer below. I arrived at the following conclusion.

log -r "head() and not closed() and user('<username>')"

In my particular case I wanted only the latest heads in reverse order so I made an alias for this functionality.

[alias]
myhist = log -r "reverse(head() and not closed() and user('<username>'))" --template "{rev}: {branches}\n" -l 10

so that calling hg myhist gives me up to ten recent changesets which are all the last one on their branch. I am using the --template option to only see the revision number and branch name so as to get a quick overview of my recent activity.

like image 692
Jon Nylander Avatar asked Jun 20 '11 12:06

Jon Nylander


People also ask

What is a head in Mercurial?

A head is a changeset with no child changesets. The tip is the most recently changed head. Other heads are recent pulls into a repository that have not yet been merged. If you have just made a commit, that commit will be the tip.

How Mercurial works?

Mercurial groups related changes to multiple files into single atomic changesets, which are revisions of the whole project. These each get a sequential revision number. Because Mercurial allows distributed parallel development, these revision numbers may disagree between users.

How do you pull in Mercurial?

Pull changes from the Mercurial upstream (Pull)From the main menu, choose Hg | Mercurial | Pull. Specify the required URL address of the source remote repository.


1 Answers

If you are using a newer version of Mercurial, you can build this query using revsets:

hg log -r "heads(all()) and not closed() and user('<user>')"

like image 66
Tim Henigan Avatar answered Oct 29 '22 10:10

Tim Henigan