Mercurial - 列出用户的头像
有没有办法列出特定用户创建的头?
使用 hg heads 命令我无法过滤用户。
虽然使用 hg log 我可以过滤用户,但无法弄清楚如何仅列出分支上的最后一个变更集。
更新:
感谢 Tim Henigan 下面的回答。我得出以下结论。
log -r "head() and not closed() and user('<username>')"
在我的特定情况下,我只想要相反顺序的最新头,因此我为此功能创建了一个别名。
[alias]
myhist = log -r "reverse(head() and not closed() and user('<username>'))" --template "{rev}: {branches}\n" -l 10
因此,调用 hg myhist
会为我提供最多十个最近的变更集,这些变更集都是其分支上的最后一个。我使用 --template
选项仅查看修订号和分支名称,以便快速了解我最近的活动。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您使用的是较新版本的 Mercurial,则可以使用 revsets 构建此查询:
< code>hg log -r "heads(all()) 且未关闭() 和 user('')"
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