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

Benoit Boissinot bboissin at gmail.com
Mon Feb 7 22:54:14 UTC 2011


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. 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.

cheers,

Benoit



More information about the Mercurial-devel mailing list