Patchwork [RESEND] log: display closing-branch nodes as "_" (BC)

login
register
mail settings
Submitter Jordi Gutiérrez Hermoso
Date March 6, 2015, 8:39 p.m.
Message ID <bf74fb1eb135c8ff4841.1425674367@Iris>
Download mbox | patch
Permalink /patch/7908/
State Accepted
Commit 4bb348ae43cbe1df9ea3928abc0b18dc6c7e3c6a
Headers show

Comments

Jordi Gutiérrez Hermoso - March 6, 2015, 8:39 p.m.
# HG changeset patch
# User Jordi Gutiérrez Hermoso <jordigh@octave.org>
# Date 1416865369 18000
#      Mon Nov 24 16:42:49 2014 -0500
# Node ID bf74fb1eb135c8ff48416a75ee427e9ed5c61df6
# Parent  67952dc7a88faf32211e61b8f9606f62d271eaf3
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.
Matt Mackall - March 6, 2015, 11:12 p.m.
On Fri, 2015-03-06 at 15:39 -0500, Jordi Gutiérrez Hermoso wrote:
> # HG changeset patch
> # User Jordi Gutiérrez Hermoso <jordigh@octave.org>
> # Date 1416865369 18000
> #      Mon Nov 24 16:42:49 2014 -0500
> # Node ID bf74fb1eb135c8ff48416a75ee427e9ed5c61df6
> # Parent  67952dc7a88faf32211e61b8f9606f62d271eaf3
> log: display closing-branch nodes as "_" (BC)

Queued for default, thanks.

Patch

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
   |