log: display closing-branch nodes as "_" (BC)
authorJordi Gutiérrez Hermoso <jordigh@octave.org>
Mon, 24 Nov 2014 16:42:49 -0500
changeset 24216 4bb348ae43cb
parent 24215 feddc5284724
child 24217 d2b81256db1e
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.
mercurial/cmdutil.py
tests/test-convert-datesort.t
tests/test-convert-filemap.t
tests/test-rebase-named-branches.t
--- a/mercurial/cmdutil.py	Fri Mar 06 17:00:42 2015 -0600
+++ b/mercurial/cmdutil.py	Mon Nov 24 16:42:49 2014 -0500
@@ -1915,6 +1915,8 @@
             char = '@'
         elif ctx.obsolete():
             char = 'x'
+        elif ctx.closesbranch():
+            char = '_'
         copies = None
         if getrenamed and ctx.rev():
             copies = []
--- a/tests/test-convert-datesort.t	Fri Mar 06 17:00:42 2015 -0600
+++ b/tests/test-convert-datesort.t	Mon Nov 24 16:42:49 2014 -0500
@@ -85,9 +85,9 @@
   $ 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 @@
   $ 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 @@
   |\
   | o  11 "c0"
   | |
-  o |  10 "b2x"
+  _ |  10 "b2x"
   | |
   o |  9 "b1"
   | |
-  | | o  8 "a7x"
+  | | _  8 "a7x"
   | | |
   | | o  7 "a6"
   | | |
--- a/tests/test-convert-filemap.t	Fri Mar 06 17:00:42 2015 -0600
+++ b/tests/test-convert-filemap.t	Mon Nov 24 16:42:49 2014 -0500
@@ -387,15 +387,15 @@
   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 @@
   1 closeempty
   0 closedefault
   $ glog -R branchpruning-hg2
-  o  1 "closedefault" files:
+  _  1 "closedefault" files:
   |
   o  0 "addb" files: b
   
--- a/tests/test-rebase-named-branches.t	Fri Mar 06 17:00:42 2015 -0600
+++ b/tests/test-rebase-named-branches.t	Mon Nov 24 16:42:49 2014 -0500
@@ -352,7 +352,7 @@
   $ 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 @@
   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
   |