View the history of mercury with blurry straight line development

I am interested to see the topology of my branches, ideally beautiful (a la graphlog). For example, I want to see how many (open) branches there are when they split, the last time they merge with each other, etc. Etc. I am not interested in all the mergers between them, as well as direct development on each branch.

This is useful when viewing forks on a bit baget, for example. The guitar graph Github helps, but often the branch structure is recessed by direct development and / or frequent mergers.

I thought maybe I could use revsets like

hg glog --rev "head() or merge() or branch_points()" 

but then glog shows all the changes between them, not to mention that I could not figure out how to specify branch_points (), that is, revisions that have more than one child.

Is there an extension to mercury (or other DVCS) that can bring my desires closer? If not, what is the best way to get this information?

+6
source share
2 answers

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, 
+2
source
  $ hg log -Gr "merge () + head ()"
+2
source

Source: https://habr.com/ru/post/913927/


All Articles