[PATCH] hg_log: speed up hg log for untracked files (issue1340)
smuralid at yahoo.com
Tue Sep 11 12:36:03 CDT 2012
Thanks for reviewing this, Matt. A few questions/comments below
> This patch should be in multiple pieces:
> - introduce the basic store method
> - introduce the fncache method
> - introduce the user in cmdutil + test
I assume that step #2 will also include the fncachestore method (along with the fncache method) - just making sure I understood the protocol here.
> I think the approach in fncache should be two-pass:
> - check for a file matching arg in the cache directly
> - scan for a directory match by iterating startswith over the cache
Another point of clarification: should I bundle this all into the __contains__ method on fncache? Are there any perf concerns about adding an extra scan of the cache (although, it'll only happen on cache misses)?
> There should never been any absolute paths?
Probably - I wasn't entirely sure, and many other functions in localrepo seemed to do that; so just wanted to be extra careful.
>> class basicstore
>> + def __contains__(self, path):
>> + '''Checks if this path exists in the store'''
>> + return self.opener.exists(path)
> Doesn't work with directories?
I didn't follow this comment, Matt?
>> diff --git a/tests/test-glog.t b/tests/test-glog.t
>> + +nodetag 3
>> + nodetag 0
This is an example where hg log shows differences in output between the slow path and the fast path (we had a discussion earlier about this - http://bz.selenic.com/show_bug.cgi?id=3613), This particular testcase is testing differences between hg log and hg log -g, and one of them now uses the fast path for an untracked file, while the other doesn't (both of them used to go through the slow path earlier)
I'll make all the other changes you suggested.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Mercurial-devel