#189 CVS.pm does not work with branching tags

SCM support (7)
Blade Doyle

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: But that isn't an actual revision number 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)


  • Blade Doyle

    Blade Doyle - 2011-11-08

    Patch for CVS.pm to work with branched tags

  • Andre-Littoz

    Andre-Littoz - 2011-11-09
    • assigned_to: nobody --> ajlittoz
    • milestone: --> current_cvs
    • labels: --> SCM support
  • Andre-Littoz

    Andre-Littoz - 2011-11-09

    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.


  • Andre-Littoz

    Andre-Littoz - 2012-01-25

    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.

  • Andre-Littoz

    Andre-Littoz - 2012-01-25
    • status: open --> closed-fixed

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks