以下补丁将分支点修订集添加到 Mercurial。它目前仅适用于 Mercurial 2.2,但在那里运行良好。
我不知道我是否有时间尽快推动纳入。您可以访问邮件列表并提出准备好将其包含在内(这样可以节省我的工作)。
修订版也在https://bitbucket.org/ArneBab/hg-stable
# HG changeset patch
# User bab@draketo.de
# Date 1343931127 -7200
# Branch stable
# Node ID f5e211663739e31f2e476c43992ee5335f9d8146
# Parent 00182b3d087909e3c3ae44761efecdde8f319ef3
revsets: added branchpoint() for revisions with more than one child.
Reason: Get very terse information via
hg glog --rev "head() or merge() or branchpoint()"
diff -r 00182b3d0879 -r f5e211663739 mercurial/revset.py
--- a/mercurial/revset.py Tue May 01 19:09:15 2012 +0900
+++ b/mercurial/revset.py Thu Aug 02 20:12:07 2012 +0200
@@ -710,6 +710,15 @@
cl = repo.changelog
return [r for r in subset if cl.parentrevs(r)[1] != -1]
+def branchpoint(repo, subset, x):
+ """``branchpoint()``
+ Changeset has more than one child.
+ """
+ # i18n: "merge" is a keyword
+ getargs(x, 0, 0, _("branchpoint takes no arguments"))
+ cl = repo.changelog
+ return [r for r in subset if cl.children(repo[r].node())[1:]]
+
def minrev(repo, subset, x):
"""``min(set)``
Changeset with lowest revision number in set.
@@ -1137,6 +1146,7 @@
"bisected": bisected,
"bookmark": bookmark,
"branch": branch,
+ "branchpoint": branchpoint,
"children": children,
"closed": closed,
"contains": contains,