Crazy idea of the day: the '+' revision

Martin Geisler mg at lazybytes.net
Sun May 23 17:23:26 CDT 2010


Matt Mackall <mpm at selenic.com> writes:

> Right now we've got a '.' revision that refers to the parent of the
> working directory. Very handy. But we've got no way to refer to the
> revision in the working directory. Internally, we can use repo[None] to
> get a working context, but there's no way to refer to it except
> implicitly on the command line. So I'm proposing adding a magical '+'
> revision for that purpose.
>
> (Why '+'? In several places like hg id we refer to a modified working
> copy as <hash>+ to indicate "changeset <hash> plus changes".)

I ilke the '<hash>+' notation a lot, but I have somehow always thought
of the '+' as standing for the output of 'hg diff'.

> For instance, diff refers to the working directory by default, if given
> zero or one argument. To produce a backwards diff, you must use the
> --reverse flag. With +, you'd be able to do hg diff -r +:. or hg diff
> -r .:+.

My initial reaction to this was: "oh no, let's not add more 'line noise'
to Mercurial." But after thinking about it again, then perhaps this
isn't as bad.

I do like Nicolas' suggestion of 'wdir' better, though since I think
it's clearer.

-- 
Martin Geisler

See my Mercurial presentation: http://vimeo.com/11497288
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20100524/e5fc3479/attachment.pgp>


More information about the Mercurial-devel mailing list