Crazy idea of the day: the '+' revision

Christian Boos cboos at neuf.fr
Mon May 24 02:46:49 CDT 2010


On 5/24/2010 12:23 AM, Martin Geisler wrote:
> 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.
>    

'+' seems clear enough, once you know the rationale behind it (and then, 
'hg help +' should tell something about it!); if there should be a plain 
text alias for '+', then I'd prefer 'dir' instead of 'wdir', as it bears 
more symmetry with 'tip' (3 letters, pronounceable).

-- Christian



More information about the Mercurial-devel mailing list