Patchwork [1,of,2] log: display closing-branch nodes as "_" (BC)

login
register
mail settings
Submitter Jordi Gutiérrez Hermoso
Date Nov. 24, 2014, 9:48 p.m.
Message ID <eefc121a32a3e1ed848f.1416865739@Iris>
Download mbox | patch
Permalink /patch/6842/
State Superseded
Commit 4bb348ae43cbe1df9ea3928abc0b18dc6c7e3c6a
Headers show

Comments

Jordi Gutiérrez Hermoso - Nov. 24, 2014, 9:48 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 eefc121a32a3e1ed848f603d062f20f2aff0cdbd
# Parent  a81c76106d9036060b3371f36b00ceefa5d60898
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.
Jordi Gutiérrez Hermoso - Nov. 24, 2014, 9:53 p.m.
Please ignore this series, I completely forgot to check tests.
Sean Farley - Nov. 24, 2014, 9:59 p.m.
Jordi Gutiérrez Hermoso writes:

> Please ignore this series, I completely forgot to check tests.

Before you check all the tests, I would say wait for discussion about
this BC.
Pierre-Yves David - Nov. 24, 2014, 11:16 p.m.
On 11/24/2014 01:48 PM, Jordi Gutiérrez Hermoso wrote:
> diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
> --- a/mercurial/cmdutil.py
> +++ b/mercurial/cmdutil.py
> @@ -1922,6 +1922,8 @@ def displaygraph(ui, dag, displayer, sho
>               char = '@'
>           elif ctx.obsolete():
>               char = 'x'
> +        elif ctx.closesbranch():
> +            char = '_'

This will probably also trigger for re-opened branches. you should only 
probably restrict this to real closed heads.
Jordi Gutiérrez Hermoso - Nov. 25, 2014, 4:04 p.m.
On Mon, 2014-11-24 at 15:16 -0800, Pierre-Yves David wrote:
> 
> On 11/24/2014 01:48 PM, Jordi Gutiérrez Hermoso wrote:
> > diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
> > --- a/mercurial/cmdutil.py
> > +++ b/mercurial/cmdutil.py
> > @@ -1922,6 +1922,8 @@ def displaygraph(ui, dag, displayer, sho
> >               char = '@'
> >           elif ctx.obsolete():
> >               char = 'x'
> > +        elif ctx.closesbranch():
> > +            char = '_'
> 
> This will probably also trigger for re-opened branches. you should only 
> probably restrict this to real closed heads.

I thought about that, but I decided against it. It will be very
obvious graphically when a closing-branch commit gets reopened, and it
would still be nice to see graphically that it was closed and then
reopened.
Pierre-Yves David - Dec. 2, 2014, 9:21 p.m.
On 11/25/2014 08:04 AM, Jordi Gutiérrez Hermoso wrote:
> On Mon, 2014-11-24 at 15:16 -0800, Pierre-Yves David wrote:
>>
>> On 11/24/2014 01:48 PM, Jordi Gutiérrez Hermoso wrote:
>>> diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
>>> --- a/mercurial/cmdutil.py
>>> +++ b/mercurial/cmdutil.py
>>> @@ -1922,6 +1922,8 @@ def displaygraph(ui, dag, displayer, sho
>>>                char = '@'
>>>            elif ctx.obsolete():
>>>                char = 'x'
>>> +        elif ctx.closesbranch():
>>> +            char = '_'
>>
>> This will probably also trigger for re-opened branches. you should only
>> probably restrict this to real closed heads.
>
> I thought about that, but I decided against it. It will be very
> obvious graphically when a closing-branch commit gets reopened,

Given how low the underscore char is I disagree with the "obvious" part.

> and it would still be nice to see graphically that it was closed and then
> reopened.

I've already seen and tested such approach (reopening) and I find is 
confusing.

Patch

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -1922,6 +1922,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 = []