[PATCH 3 of 4] Add option to heads to show only heads for current branch

Eric M. Hopper hopper at omnifarious.org
Wed Jun 13 00:43:05 CDT 2007


On Tue, 2007-06-12 at 23:01 -0500, Matt Mackall wrote:
> On Tue, Jun 12, 2007 at 12:46:23PM -0700, Eric Hopper wrote:
> > +        for branch in branches:
> > +            if branch == '.':
> > +                realbranch = repo.changectx('.').branch()
> > +            else:
> > +                realbranch = branch
> 
> I think we want to simply do repo.changectx(branch).branch(). That is:
> 
> hg heads 3000  # find the branch that rev 3000 is on and report its
>                  branch heads

I thought about that.  I guess that works, even if you name a branch
because the code will look up the tip of the branch.

> 
> > +          ('b', 'branch', None, _("show even inactive heads for just the current branch")),
> 
> I still think we should show all heads by default. Can we use the same
> flag as we use for hg branches?

I forgot to remove that flag.  It doesn't actually have an effect
anymore.  I also need to update the help text for 'heads' slightly.

I actually think all of the Mercurial commands should be changed to
restrict to branch by default, or that there should be a global option
or a config option the selects that behavior.  I thought maybe there
should be a global option for both turning on and turning off branch
locality that will override the UI option, whatever it's set to.

I( think something like that would do a lot to make branches more useful
in general.

I also think there should be a global option for showing full hashes
instead of shortened ones.  But that's not related to the branch
thing.  :-)

Have fun (if at all possible),
-- 
The best we can hope for concerning the people at large is that they
be properly armed.  -- Alexander Hamilton
-- Eric Hopper (hopper at omnifarious.org  http://www.omnifarious.org/~hopper) --
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 185 bytes
Desc: This is a digitally signed message part
Url : http://selenic.com/pipermail/mercurial-devel/attachments/20070612/73d773ee/attachment-0001.pgp 


More information about the Mercurial-devel mailing list