Re: Interfacing BitKeeper to LXR
Malcolm Box <[email protected]> Tue, 11 Jan 2005 00:56:53 +0000
| Newsgroups | gmane.comp.version-control.bitkeeper.user |
|---|---|
| Message-ID | <[email protected]> |
Wayne Scott wrote: > From: Malcolm Box <[email protected]> > >>I'm trying to code up an interface between LXR (http://lxr.sf.net) and >>BitKeeper, to enable source browsing of the linux kernel trees. > > > It would be helpful if you included a brief summary of lxr since that > website doesn't contain any useful information. I am guessing it is a > source code browser. 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. >>I've run into some problems with working out what commands to use to get >>the information I need out of BitKeeper, any hints or suggestions would >>be much appreciated: >> >>1. Discovering the contents of a directory at a certain revision > > > Need to be careful with terms here. I am guessing you are asking for > the contents as of a certain cset. Yes, I think I mean cset here - I'm still getting used to BK's terminology. I'm looking to be able to index the various released revisions of Linux, and assuming that these will be identified by a cset identifier or label. >>Currently I'm using "bk prs -r<rev>" from the root of the repository, >>parsing the output, building the full directory tree and then retrieving >>the contents of the directory I want. This works, but is much slower >>than I would like - I'm having to process the entire directory tree >>simply to e.g. read the contents of the root directory. > > 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 [email protected]|net/ipv6/netfilter/ip6t_hl.c|20030303093100|14807|d60df4aaa189743" - is this something I should worry about, or just ignore? 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. >>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 [email protected] 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? >>3. Working out whether a file exists at a certain changelist >> >>It would be useful to be able to take a pathname, changelist combination >>and have a quick way to discover if that file exists at that revision. >>I can't work out what commands would work for that. >> >>Any help would be much appreciated. > > > Again rset. > > Historic pathnames are tricky. Bk doesn't work with pathnames because > they are not stable. Internally everything is done with a unique > identifier for files called the rootkey. 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. Thanks for the help - any further light you can shed would be welcome. Cheers, Malcolm _______________________________________________ Bitkeeper-users mailing list [email protected] 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.