Integration of Mercurial into LXR

andre-littoz page74010-sf at yahoo.fr
Thu Dec 13 07:07:26 CST 2012


Hello,

I am the present LXR (Linux Cross-Referencer - see http://lxr/sourceforge.net) administrator/developer and trying to extend LXR beyond plain files/CVS/Git/svn storage engine.

I succeeded in implementing an experimental backend storage engine to work with local Mercurial repositories. Unhappily, it runs horribly slow (approximately 10 times slower than git or Subversion on the same test case). Certainly because that's my first contact with hg.

One of the first LXR tasks is to display a directory view, same as hgweb does. To retrieve directory content, I found nothing else than the following command:
hg locate -r "revision of interest" a_directory/**

This implies to traverse the full repository, where I only want the present directory, without its subdirectories. I can't use * pattern because I want to build a list of the subdirectories. The command reports the complete sub-tree rooted at the requested directory. I must then filter out the sublevels. This is a double waste: first inside Mercurial to report the tree, next inside LXR to prune unwanted information.

When it comes to compute file size, I had to
hg cat -r "revision of interest" "a_file" | wc

which means extract the file and throw it away for every line in the directory list.

This is really inefficient.

I had a look at the source of hgweb to discover it used internal templates names fentries and dentries which contain apparently the information needed by LXR.


Is there a simple and efficient command line to
1- get a "standard" directory list like ls or ls -F
2- retrieve a file size

or
3- have access to information supplied by {fentries} and {dentries} templates?

Thanks for your help
André Littoz
LXR administrator
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20121213/e9576056/attachment.html>


More information about the Mercurial-devel mailing list