hg log and directories

Matt Mackall mpm at selenic.com
Thu Sep 6 21:52:48 CDT 2012


On Thu, 2012-09-06 at 17:27 -0700, S Muralidhar wrote:
> Hi folks,
> I'd like a bit of guidance on an issuing I'm tracking. 
> 
> I'm looking into fixing Issue 1340:
> (http://bz.selenic.com/show_bug.cgi?id=1340) - which complains about
> "hg log" being slow for untracked files.

> The root case seems to be in function walkchangerevs() in cmdutil.py,
> which checks to see if the specified file has a revlog. If not, it
> decides to use a "slow path" (that walks the revision tree backwards
> to see if there the file existed as of that revision). 

The fncache is implemented as a subclass of a 'basicstore' in store.py,
partly to solve this exact problem (which we've obviously known about
for a long time). Store objects are the ones charged with knowing how to
map filenames in history to filenames in store, so this is the right
level to add a method to ask 'have we ever seen this path?'. You'll
probably want one in basicstore that queries the fs, and another in the
fncachestore that queries the cache, and not the fs. The latter might
not be instantaneous, but will be a lot faster than the log slow path.

I'd prefer to see a method named something like "__contains__(self,
path)" rather than "isorwasdir" though.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list