[PATCH 1 of 2] Add tolerant option to log command

Jason Harris jason.f.harris at gmail.com
Mon Dec 13 10:06:01 CST 2010


On Dec 13, 2010, at 7:08 AM, Matt Mackall wrote:

> On Sun, 2010-12-12 at 06:28 +0100, Jason Harris wrote:
>> On Dec 12, 2010, at 6:08 AM, Augie Fackler wrote:
>> 
>>> On Dec 11, 2010, at 9:20 PM, Jason Harris wrote:
>>>> 
>>>> # HG changeset patch
>>>> # User jfh <jason at jasonfharris.com>
>>>> # Date 1292119613 -3600
>>>> # Node ID 5eec305ce06f7f096871f70aacedcd838eb802c2
>>>> # Parent  4a13ca2c21cefc6409072d9f3bd55a1e8d75b6e1
>>>> Add tolerant option to log command
>>>> 
>>>> Allow revision ranges outside the repository to be handled tolerantly. For
>>>> instance assume that the repository has 15 changesets and the user asks for log
>>>> --tolerant --rev "0:23" then Mercurial should interpret this request as --rev
>>>> "0:15" and not fail with an abort: unknown revision '23'! error.
>>>> 
>>>> This is important for GUI clients which are working in a multithreaded way when
>>>> strip or collapse or histedit operations are taking place the size of the
>>>> repository can become smaller while a status update of the size of the
>>>> repository is underway.
>>>> 
>>>> Conceivably this should just happen automatically for --noninteractive?
>>> 
>>> Why can't you do --rev 0:-1 for that use case and have it work?
>> 
>> Ahhh... The message here is dealing with a simplified case so its
>> easily understood what I am doing. However in practice the GUI works
>> in a very incremental way. More likely in practice the requested range
>> will be something like eg --rev "1589:1689" . Its not at all clear
>> that you want to go to the tip, the tip might be at 3000 but if the
>> instruction executed is "hg strip 1200" then I'll have problems...
> 
> Some revset magic for you:
> 
> hg log -r '1589:(present(1689) or tip)'
> 
> But this doesn't really solve your problem. If 1689 disappears between
> the time we check whether it's present and the time we try to decompress
> the changelog entry, you still lose.

Thanks! I actually played with changing the reveset code and I introduced "truncated" in my local copy ie being able to -r 'truncated(1589:1689)'  yet I found the processing was quite a bit slower in some cases whenever the revset options were present. Eg with your revest magic:

[Bolt:QuickSilver/Development/sandbox/openOffice] openOffice 262741(262741) ⌘ time hg log -r '262600:(present(262700) or tip)' --template "{rev}:{node}\n" >> /dev/null

real	0m0.560s
user	0m0.459s
sys	0m0.096s

[Bolt:QuickSilver/Development/sandbox/openOffice] openOffice 262741(262741) ⌘ time hg log -r '262600:tip' --template "{rev}:{node}\n" >> /dev/null

real	0m0.125s
user	0m0.087s
sys	0m0.035s

Cheers,
  Jas



More information about the Mercurial-devel mailing list