[prev in list] [next in list] [prev in thread] [next in thread] 

List:       bitkeeper-users
Subject:    Re: [Bitkeeper-users] Interfacing BitKeeper to LXR
From:       Wayne Scott <wscott () bitmover ! com>
Date:       2005-01-11 14:30:23
Message-ID: 20050111.093023.115910975.wscott () bitmover ! com
[Download RAW message or body]

From: Malcolm Box <malcolm@brownale.demon.co.uk>
> Sorry, you're right that is a spectacularly poor website.  Mea culpa, I 
> probably should get round to fixing it one day!  The LXR was/is the 
> Linux Cross Referencer - see http://lxr.linux.no/source for the original 
> site and some idea of the sort of output I'm looking to generate from 
> BitKeeper.

So you want something like a CGI that will generate this output live
from bk.  Kind of like this bkweb view:

> > You might want to look at 'bk rset -l<csetrev>'
> 
> This looks promising - thanks!  I seem to get a few errors of the form 
> "Cannot keyinit 
> laforge@netfilter.org|net/ipv6/netfilter/ip6t_hl.c|20030303093100|14807|d60df4aaa189743" 
> - is this something I should worry about, or just ignore?

That shouldn't be happening.  Try running 'bk -r check -av' first.

> It also seems that I will still have to build a entire tree 
> representation of the repository at that point as the rset command 
> doesn't allow me to ask for a directory.

Yes and rset is a slow operation and the structure of bk's metadata
makes that difficult to change.

> >>2. Finding the contents of a file at a certain revision - e.g. x/y/z @a.b.c
> >>
> >>The obvious command to use is "bk get -p -r@a.b.c x/y/z", but this 
> >>doesn't appear to work if x/y/z has been deleted after changelist a.b.c 
> >>even if the file did exist at the specified changelist.  "bk get" just 
> >>reports that x/y/SCCS/s.z doesn't exist, which isn't that helpful!
> >  
> > Well the file names on the command line are pathnames in the latests
> > cset.  The command line you gave was:
> 
> Ah!  Light is starting to dawn.  Call me thick, but I assumed that they 
> were against the repository at the cset specified, and not the latest cset.
> 
> 
> >     Give me the contents of the file that is currently named 'x/y/z'
> >     as of cset a.b.c.  (That file might have been at a different location
> >     at that cset.)
> > 
> > Look at 'bk help rset' at the -h option which lists the historic and
> > current locations of files that are listed.
> 
> It looks like rset can tell me where a file is/was but not give me its 
> actual contents at that point.  bk export does what I need but I want 
> only one file, not the whole repository.  Is there any way to cut this down?

Yes you can pass -i and -x to export to restrict it to just export a
portion of the tree. But internally it calls a full rset so that
doesn't help much.

> > Historic pathnames are tricky.  
> 
> Sure, I appreciate that pathnames are not stable.  But the LXR tries to 
> give the impression that you are browsing mulitple directory trees, each 
> representing one version of the source code.  In other words it's 
> functionally equivalent to running "bk export" for a set of csets, with 
> each command outputting to its own directory.  So at a given cset, it's 
> a valid question to ask if there is a file with a particular pathname - 
> I'm looking for a quick way to calculate this, but if I've understood 
> you the way to do this is to take the output of bk rset -l<rev> and use 
> that to build a picture of the entire repository. I.e. there's no way to 
> ask bk to calculate a part of the tree for you.

No.  Mainly because it can't be done quickly.  Bk doesn't know which
files that are not in that directory currently might have been there
in the past.

> Thanks for the help - any further light you can shed would be welcome.

Really the solution appears to be that you should just move to a full
'bk export' of all the data for a given tag.  Keep a cache of full
source trees for all the tags that people have browsed recently and
then read the exported tree.  When the user first looks at a new tag
create a new export tree. 

-Wayne
_______________________________________________
Bitkeeper-users mailing list
Bitkeeper-users@bitmover.com
http://bitmover.com/mailman/listinfo/bitkeeper-users
To unsubscribe from this list, go to the above URL, follow instruction at the bottom of the web page.
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic