[PATCH 1 of 4] do not display closed heads in 'hg heads' by default

John Mulligan phlogistonjohn at asynchrono.us
Sun May 31 15:12:56 CDT 2009


On Sun, May 31, 2009 at 02:16:37PM -0500, Matt Mackall wrote:
> On Sun, 2009-05-31 at 18:11 +0000, John Mulligan wrote:
> > # HG changeset patch
> > # User John Mulligan <phlogistonjohn at asynchrono.us>
> > # Date 1243790351 14400
> > # Node ID 25fa695f61c983e5880637667b09f801f3383e2f
> > # Parent  45f626a39def2b1b8f7302453df35e4e929bfaae
> > do not display closed heads in 'hg heads' by default
> > 
> > add --closed (-c) option to 'hg heads' to show all heads
> > remove --active (-a) from 'hg heads' as it is obsoleted by --closed
> 
> I'm afraid we can't do that without first deprecating -a for -at least-
> one release cycle. 
> 

Ah, I should have expected that. :-)

> I'm also not sure this is quite right. We've got several related but
> distinct concepts:
> 
> - heads (ie 'hg heads')
> - branch heads (ie 'hg heads <branch>')
>   - active/inactive branch heads
>   - open/closed branch heads
> 
> Your summary suggests (probably incorrectly) that this patch will leave
> us with only:
> 
> - open/closed branch heads

Yeah, it is rather muddled at this point. With the original
branch-closing patches I was overloading the concept of what --active
was doing on 'hg branches' and then copied that switch to 'hg heads'. 
Looking back now, this probably wasn't the best choice.

I especially regret this because 'hg heads <branch>' and 'hg heads -a
<branch>' did nothing at all related to active/inactive branch heads.
All -a ever did on heads was effect open/closed status. Only on 
'hg branches' was the active/inactive branch heads distinction exposed.

(At the time I was thinking something like: inactive = unwanted, as 
opposed to the real meaning that the head has no children on the
same branch. It doesn't matter now, but it makes me feel better if
I try and justify something that looks like a dumb move now.)

> 
> I think for now, we want to leave all existing hg heads behavior as it
> is, but:
> 
> - hide closed branches in 'hg heads <branch>' by default
> - show them with -c
> 
> We might eventually decide active/inactive is a useless distinction, but
> for now I think we should leave it.
> 

This is what I think I should do, please let me know what you think.


1. Add the -c option to 'hg heads', and do not display closed heads by
default.

2a. Mark -a on 'hg heads' as deprecated. In the meantime since -a and -c 
are opposites specifying both should display an error.

OR

2b. Make -a on 'hg heads' actually do something useful. Like not
displaying inactive branch heads for 'hg heads -a <branch>'


3. Discuss changing 'hg branches'. If the distinction between 
-a and -c on 'hg heads' is useful we may want to extend it to cover 
'hg branches' too. That would probably mean that all fully closed 
branches would not display on hg branches by default, but inactive 
branches would. (I would probably do this in a later patch series)




More information about the Mercurial-devel mailing list