[PATCH RFC] commands, context: allow to annotate working-copy revision

Matt Mackall mpm at selenic.com
Mon Feb 7 17:13:57 CST 2011


On Mon, 2011-02-07 at 23:54 +0100, Benoit Boissinot wrote:
> On Sun, Feb 6, 2011 at 12:11 PM, Yuya Nishihara <yuya at tcha.org> wrote:
> > # HG changeset patch
> > # User Yuya Nishihara <yuya at tcha.org>
> > # Date 1296990265 -32400
> > # Node ID 511aa87eeb262131bfd08655bab6fa94218750eb
> > # Parent  69e69b131458023d21ec40aa48fc5299e43ce69b
> > commands, context: allow to annotate working-copy revision
> >
> > It changes 'hg annotate' command to annotate working-copy revision by default.
> > wctx rev and nodeid are displayed as blank in annotation result.
> >
> 
> I don't really like returning None, for wctx.rev(), in your case it
> doesn't simplify anything since you still need to test for None
> everywhere.
> Can't you explicitly test for ctx is an instance of wctx?
> 
> >
> > Things I'm not sure:
> > - It might not be appropriate to change the default behavior of annotate
> >  command. But there's no way to specify working-copy revision explicitly.
> > - Is empty string good to denote working-copy rev and nodeid in annotation
> >  result?
> 
> We can't change the default behaviour like that.

Indeed.

>  I don't remember but
> didn't we introduce something to denote the working copy rev with
> revsets? That way you could use it with -r.

There've been a couple proposals for that, but nothing's been
implemented. I originally favored '+' as an alias, but revsets ate that.

And yes, we need to come up with a rev() semantic for the working
revision that doesn't break/complicate everything.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list