# HG changeset patch # User Jordi GutiƩrrez Hermoso # Date 2014-11-24 21:42:49 # Node ID 4bb348ae43cbe1df9ea3928abc0b18dc6c7e3c6a # Parent feddc528472414d6913ef288aa7c1922669a5840 log: display closing-branch nodes as "_" (BC) In plain `hg log` there is no indication that a commit closes a branch. You can use hg log --debug, but this is too verbose. A simple idea copied from thg and other graphical viewers is to display the node for a closing-branch commit as a horizontal line. I think this technically is a BC if we consider the graphlog to be part of the stdout API, but I really can't imagine who the hell is parsing the graphlog to determine information about commits. diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -1915,6 +1915,8 @@ def displaygraph(ui, dag, displayer, sho char = '@' elif ctx.obsolete(): char = 'x' + elif ctx.closesbranch(): + char = '_' copies = None if getrenamed and ctx.rev(): copies = [] diff --git a/tests/test-convert-datesort.t b/tests/test-convert-datesort.t --- a/tests/test-convert-datesort.t +++ b/tests/test-convert-datesort.t @@ -85,9 +85,9 @@ graph converted repo $ hg -R t-datesort log -G --template '{rev} "{desc}"\n' o 12 "c1" |\ - | o 11 "b2x" + | _ 11 "b2x" | | - | | o 10 "a7x" + | | _ 10 "a7x" | | | o | | 9 "c0" | | | @@ -136,9 +136,9 @@ graph converted repo $ hg -R t-sourcesort log -G --template '{rev} "{desc}"\n' o 12 "c1" |\ - | o 11 "b2x" + | _ 11 "b2x" | | - | | o 10 "a7x" + | | _ 10 "a7x" | | | o | | 9 "c0" | | | @@ -189,11 +189,11 @@ graph converted repo |\ | o 11 "c0" | | - o | 10 "b2x" + _ | 10 "b2x" | | o | 9 "b1" | | - | | o 8 "a7x" + | | _ 8 "a7x" | | | | | o 7 "a6" | | | diff --git a/tests/test-convert-filemap.t b/tests/test-convert-filemap.t --- a/tests/test-convert-filemap.t +++ b/tests/test-convert-filemap.t @@ -387,15 +387,15 @@ test branch closing revision pruning if 1 addb 0 closedefault $ glog -R branchpruning-hg1 - o 5 "closedefault" files: + _ 5 "closedefault" files: | o 4 "addb" files: b | - | o 3 "closeempty" files: + | _ 3 "closeempty" files: | | | o 2 "emptybranch" files: |/ - | o 1 "closefoo" files: + | _ 1 "closefoo" files: |/ o 0 "adda" files: a @@ -422,7 +422,7 @@ exercise incremental conversion at the s 1 closeempty 0 closedefault $ glog -R branchpruning-hg2 - o 1 "closedefault" files: + _ 1 "closedefault" files: | o 0 "addb" files: b diff --git a/tests/test-rebase-named-branches.t b/tests/test-rebase-named-branches.t --- a/tests/test-rebase-named-branches.t +++ b/tests/test-rebase-named-branches.t @@ -352,7 +352,7 @@ rebase 'c1' to the branch head 'c2' that $ hg ci -qm 'c2 closed' --close $ hg up -qr 2 $ hg tglog - o 4: 'c2 closed' c + _ 4: 'c2 closed' c | o 3: 'b1' b | @@ -366,7 +366,7 @@ rebase 'c1' to the branch head 'c2' that nothing to rebase - working directory parent is also destination [1] $ hg tglog - o 4: 'c2 closed' c + _ 4: 'c2 closed' c | o 3: 'b1' b |