hg history

Thomas Arendsen Hein thomas at intevation.de
Fri Jul 1 13:04:19 UTC 2005


* Kevin Smith <yarcs at qualitycode.com> [20050701 14:33]:
> Thomas Arendsen Hein wrote:
> >Giving longer lists is still possible with more than two -r
> >arguments, e.g. displaying only tip and 0.6 with:
> >
> >hg log -r tip -r tip -r 0.6
> >       \___range___/
> 
> Icky! I really don't like having a series of -r parameters where 
> alternate ones have different meanings.

This is inherited from 'hg|cvs diff', so 'hg log -r A -r B' should
work like 'hg diff -r A -r B'.
'hg log -r A' should give only revision A, everything else would be
strange.

I could have stopped here with not allowing more than two '-r'
options, and generally one wouldn't use more than two, except it is
from inside a script or something. If I want to see a few revisions,
I can can call 'hg log -r rev' as often as I need it, but if a
script wants to do this 1500 times, there should be a way to avoid
the startup time of the python.

Maybe even something like '-r -' might be useful where a list of
revisions can be provided via stdin?

> Pasting and editing a previous 
> command that worked could get very confusing. Also, there is ambiguity 
> because I would expect this to give me three independent logs, one for 
> each of the mentioned revisions:
>   hg log -r 0.1 -r 0.2 -r 0.3
> 
> Perhaps we could use some delimeter so you have something more like:
>   hg log -r tip:0.6 -r 0.4 -r 0.3:0.2

Believe me, I thought about all this, too, but there are few
possibilities when trying to be compatible to diff. One enhancement
might be to add a '--rr 0.6' switch which behaves like '-r 0.6 -r 0.6'.
Another might be to allow a list of ranges and revisions if there is
only one -r switch, e.g.: hg log -r tip:0.6+0.4+0.3:0.2

> Or I would be happy with this:
>   hg log --from tip --to 0.6 -r 0.4 --from 0.3 --to 0.2

I always hated this after I used this kind of notation in another
project.

> Or maybe
>   hg log -r tip 0.6

This breaks option handling. If you use '-r "tip 0.6"', then you
have the same as my example above (just with space instead of +).

> for a single range, and if you want more than one range, pass a text 
> file that has them listed:
>   hg log -f revision-ranges.txt

I already thought about allowing to pass a list of ranges with
'-r -' from stdin.

> Or maybe it's just not worth allowing multiple ranges on one command line?

Nobody has to use them. The possibility is there, but mainly for
scripts. Therefore 'hg help log' only shows: hg log [-r A] [-r B] [file]

Thomas

-- 
Email: thomas at intevation.de
http://intevation.de/~thomas/



More information about the Mercurial mailing list