Interface SvnLogBuilder
- All Known Implementing Classes:
Builder
public interface SvnLogBuilder
Interface for defining a Builder that constructs a data structure from a SVM
logfile. SvnLogfileParser takes an instance of this interface and
will call methods on the interface for every piece of data it encounters in
the log.
First, buildModule(String) will be called with the name of the module. Then,
buildFile(String, boolean, boolean, Map, Map) will be called with the filename and other pieces of
information of the first file in the log. Then, for every revision of this
file, buildRevision(RevisionData) is called. The calls to buildFile and
buildRevision are repeated for every file in the log.
The files are in no particular order. The revisions of one file are ordered by time, beginning with the most recent.
- Version:
- $Id: SvnLogBuilder.java 351 2008-03-28 18:46:26Z benoitx $
- Author:
- Richard Cyganiak invalid input: '<'richard@cyganiak.de>, Tammo van Lessen
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddToAttic(String filename) Adds a file to the attic.voidbuildFile(String filename, boolean isBinary, boolean isInAttic, Map revBySymnames, Map dateBySymnames) Starts building a new file.voidbuildModule(String moduleName) Starts building a module.voidbuildRevision(RevisionData data) Adds a revision to the last file that was built..New in StatSVN: We need to have access to FileBuilders after they have been created to populate them with version numbers later on.booleanmatchesPatterns(String filename) Matches a filename against the include and exclude patterns.booleanmatchesTagPatterns(String tag) Matches a tag against the tag patterns.voidupdateRevision(String filename, String revisionNumber, int linesAdded, int linesRemoved) New in StatSVN: Updates a particular revision for a file with new line count information.
-
Method Details
-
buildModule
Starts building a module.- Parameters:
moduleName- the name of the module
-
buildFile
void buildFile(String filename, boolean isBinary, boolean isInAttic, Map revBySymnames, Map dateBySymnames) Starts building a new file. The files are not processed in any particular order.- Parameters:
filename- the file's name with path relative to the module, for example "path/file.txt"isBinary- true if it's a binary fileisInAttic- true if the file is dead on the main branchrevBySymnames- maps revision (string) by symbolic name (string)dateBySymnames- maps date (date) by symbolic name (string)
-
buildRevision
Adds a revision to the last file that was built.. The revisions are added in SVN logfile order, that is starting with the most recent one.- Parameters:
data- the revision
-
addToAttic
Adds a file to the attic. This method should only be called if our first invocation to (@link #buildFile(String, boolean, boolean, Map)) was given an invalid isInAttic field. This is a way to handle post-processing of implicit deletions at the same time as the implicit additions that can be found in Subversion.- Parameters:
filename- the filename to add to the attic.
-
getFileBuilders
Map getFileBuilders()New in StatSVN: We need to have access to FileBuilders after they have been created to populate them with version numbers later on.- Returns:
- this builder's contained (@link FileBuilder)s.
-
updateRevision
New in StatSVN: Updates a particular revision for a file with new line count information. If the file or revision does not exist, action will do nothing. Necessary because line counts are not given in the log file and hence can only be added in a second pass.- Parameters:
filename- the file to be updatedrevisionNumber- the revision number to be updatedlinesAdded- the lines that were addedlinesRemoved- the lines that were removed
-
matchesPatterns
Matches a filename against the include and exclude patterns. If no include pattern was specified, all files will be included. If no exclude pattern was specified, no files will be excluded.- Parameters:
filename- a filename- Returns:
- true if the filename matches one of the include patterns and does not match any of the exclude patterns. If it matches an include and an exclude pattern, false will be returned.
-
matchesTagPatterns
Matches a tag against the tag patterns.- Parameters:
tag- a tag- Returns:
- true if the tag matches the tag pattern.
-