开发者

Mercurial - listing a user's heads

开发者 https://www.devze.com 2023-03-13 22:48 出处:网络
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.

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.


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>')"


The above suggestion got me close but didn't quite work. this one worked better

hg log -u smoosvi -r "head() and not closed()"
0

精彩评论

暂无评论...
验证码 换一张
取 消