[PATCH] cat: increase perf when catting without patterns

Durham Goode durham at fb.com
Tue Jan 14 15:54:00 CST 2014


On 1/12/14 6:41 AM, "FUJIWARA Katsunori" <foozy at lares.dti.ne.jp> wrote:

>At Fri, 10 Jan 2014 19:17:30 -0800,
>Durham Goode wrote:
>> 
>> # HG changeset patch
>> # User Durham Goode <durham at fb.com>
>> # Date 1389405865 28800
>> #      Fri Jan 10 18:04:25 2014 -0800
>> # Node ID c4d55205c7d81950d631debed3c044c82e87cbd9
>> # Parent  d2704c48f4176d8cd6f21d33500820d44763585c
>> cat: increase perf when catting without patterns
>> 
>>
>
>Before this patch, "hg cat" matches the pattern without explicit kind
>(like "glob:") against not only file but also directory, because
>default pattern kind of "scmutil.match()" is "relpath".
>
>But this patch seems to match the pattern without explicit kind
>against only file. This may break backward compatibility.
>
>
>BTW, pattern matching of this patch seems to be similar to one of
>"filelog()"/"contains()" revset predicates. I'm just working for the
>patch to add explanation about "the pattern without explicit kind is
>not matched against directory for efficiency" for online help of them :-)

I've sent a V2 that addresses this issue, and moves some of the benefit
into ctx.walk like Martin suggested.



More information about the Mercurial-devel mailing list