Class CvsLogUtils


  • public class CvsLogUtils
    extends java.lang.Object
    Utility class containing various methods related to CVS logfile parsing
    Version:
    $Id: CvsLogUtils.java,v 1.5 2008/04/02 11:22:15 benoitx Exp $
    Author:
    Richard Cyganiak
    • Constructor Summary

      Constructors 
      Constructor Description
      CvsLogUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String getModuleName​(java.lang.String rcsFilename, java.lang.String workingFilename)
      Determines the module name by comparing the RCS filename and the working filename.
      static boolean isBinaryKeywordSubst​(java.lang.String kws)
      Returns true if files with a given keyword substitution should be treated as binary files.
      static boolean isInAttic​(java.lang.String rcsFilename, java.lang.String workingFilename)
      Determines if a file is in the attic by comparing the location of the RCS file and the working file.
      static boolean isOnMainBranch​(java.lang.String revisionNumber)
      Returns true if this revision is part of the main branch, and false if it is part of a side branch.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CvsLogUtils

        public CvsLogUtils()
    • Method Detail

      • isInAttic

        public static boolean isInAttic​(java.lang.String rcsFilename,
                                        java.lang.String workingFilename)

        Determines if a file is in the attic by comparing the location of the RCS file and the working file.

        The RCS file is the file containing the version history. It is located in the CVSROOT directory of the repository. It's name ends in ",v". The filename is absoulte.

        The working filename is the actual filename relative to the root of the checked-out module.

        A file is said to be in the attic if and only if it is dead on the main branch. If a file is in the attic, it's RCS file is moved to a subdirectory called "Attic". This method checks if the RCS file is in the "Attic" subdirectory.

        Parameters:
        rcsFilename - a version-controlled file's RCS filename
        workingFilename - a version-controlled file's working filename
        Returns:
        true if the file is in the attic
      • isOnMainBranch

        public static boolean isOnMainBranch​(java.lang.String revisionNumber)
        Returns true if this revision is part of the main branch, and false if it is part of a side branch. Revisions like 1.1 and 5.212 are on the main branch, 1.1.1.1 and 1.4.2.13 and 1.4.2.13.4.1 are on side branches.
        Parameters:
        revisionNumber - the revision's number, for example "1.1"
        Returns:
        true if this revision is part of the main branch.
      • getModuleName

        public static java.lang.String getModuleName​(java.lang.String rcsFilename,
                                                     java.lang.String workingFilename)
        Determines the module name by comparing the RCS filename and the working filename.
        Parameters:
        rcsFilename - a version-controlled file's RCS filename
        workingFilename - a version-controlled file's working filename
        Returns:
        the module name
      • isBinaryKeywordSubst

        public static boolean isBinaryKeywordSubst​(java.lang.String kws)
        Returns true if files with a given keyword substitution should be treated as binary files. That is, they should be assumed to be 0 lines of code. Possible values are the same as for the -kXXX option of CVS (for example, kv, kvl, b).
        Parameters:
        kws - the keyword substitution, as of CVS option -kXXX
        Returns:
        true if this is a binary keyword substitution
        Throws:
        java.lang.IllegalArgumentException - if kws is not a known keyword substitution