The following patch adds a branch point to the branch in Mercurial. Currently, it only applies to Mercurial 2.2, but there it works well.
I donβt know if I can quickly click on the switch. You can go to the mailing list and suggest getting ready for inclusion (which will save me from this job).
Revision is also located at 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,
source share