Crazy idea of the day: the '+' revision

rupert.thurner rupert.thurner at gmail.com
Mon May 24 04:13:30 CDT 2010


On May 20, 8:15 pm, Matt Mackall <m... at selenic.com> wrote:
> 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".)
>
> 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 .:+.
>
> With hg annotate -r +, you could annotate the copy of a file in the
> working directory, with annotate reporting +.
>
> Obviously, this concept affects just about every command. So we need to
> figure out what would break, what would be improved, and whether it
> makes sense on balance. Thoughts?

is there anything comparable in git or other vcs ?

rupert.


More information about the Mercurial-devel mailing list