[Lxr-dev] [ lxr-Bugs-3434724 ] CVS.pm does not work with branching tags
Brought to you by:
ajlittoz
From: SourceForge.net <no...@so...> - 2012-01-25 17:56:34
|
Bugs item #3434724, was opened at 2011-11-07 17:38 Message generated for change (Comment added) made by ajlittoz You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=390117&aid=3434724&group_id=27350 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: SCM support Group: current cvs >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Blade Doyle (bladedoyle) Assigned to: Andre-Littoz (ajlittoz) Summary: CVS.pm does not work with branching tags Initial Comment: LXR version: 0.9.10 No indexes are created for branched tags Using CVS.pm ---------------------- The "CVS.pm" code for "sub parsecvs" does not work with branching tags. No indexes are created for them. For branches RCS version numbers contain a "0" to indicate they are a branch. When mapping 'symbols' to a real revision number the code needs to find what actual revision number for a branching tag is. Currently for a branched tag the parsecvs function looks through the rcs file and finds that a branching tag (ex: FOO) is associated with revision (ex: 1.2.0.3). But that isn't an actual revision number 1.2.0.3. So we need some additional code in the parsecvs function to find the actual revision number for branched tags. I am attaching an example of some code that appears to solve the problem. (I don't claim to be an expert on the RCS file format but I looked at a few rcs files and found a pattern that seems to hold up) ---------------------------------------------------------------------- >Comment By: Andre-Littoz (ajlittoz) Date: 2012-01-25 09:56 Message: Phew! That was a hard one. It is not enough to manipulate the release-id in the CVS header, the file must also be "reconstructed" from the change history so that the correct length (and adequate annotations) is computed. I kept the idea of truncating void branches to their branching point. I extended this trick to imported releases because the source is usually not present in the CVS repository. In this case, imported releases are truncated at 1.1. New checks in parsecvs() for branch tags and import branches New algorithm in getannotations() to following vertices in the history graph from 'head' to the target release-id genxref needs to be modified to explore side branches. Added an automatic version discovery feature with --allversions. In this case, it is better to purge the indexing DB from any previous data. This needed to add a new method purgeall() to Files.pm. The existing purge($releaseid) can't be used because we have no idea of the present releases in the DB. Making queries for that is too much expensive compared to the brute force purge. As a side-effect, genxref --allversions creates a file listing all releases encountered during indexing. This file may later be used as 'range' for variable 'v' thus avoiding to recompute the version set on every invocation. However, this list being the union of all possible releases for every source file contains irrelevant versions for a given source file. Finally, annotation display was a bit improved with the insertion of a <span class="annot-cur"> to highlight the latest added lines to CVS repository. ---------------------------------------------------------------------- Comment By: Andre-Littoz (ajlittoz) Date: 2011-11-09 00:45 Message: Thanks Blade. I'll make tests as soon as I have some spare time and see if it can be made into a generic rule. I'll issue a 0.10 release when checking is complete. ajl ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=390117&aid=3434724&group_id=27350 |