Crazy idea of the day: the '+' revision
Matt Mackall
mpm at selenic.com
Thu May 20 13:15:01 CDT 2010
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?
--
Mathematics is the supreme nostalgia of our time.
More information about the Mercurial-devel
mailing list