Package org.tigris.subversion.javahl
Class Mergeinfo
java.lang.Object
org.tigris.subversion.javahl.Mergeinfo
- All Implemented Interfaces:
java.io.Serializable
public class Mergeinfo
extends java.lang.Object
implements java.io.Serializable
Merge history for a path.
- Since:
- 1.5
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate java.util.Map<java.lang.String,
java.util.List<RevisionRange>> A mapping of repository-relative paths to a list of revision ranges.private static final long
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addRevisionRange
(java.lang.String mergeSrc, RevisionRange range) Add a revision range to the merged revisions for a path.void
addRevisions
(java.lang.String mergeSrc, RevisionRange[] ranges) Add one or more RevisionRange objects to merge info.java.lang.String[]
getPaths()
Get the merge source URLs.getRevisionRange
(java.lang.String mergeSrc) Get the RevisionRange objects for the specified merge source URLjava.util.List<RevisionRange>
getRevisions
(java.lang.String mergeSrc) Get the revision ranges for the specified merge source URL.void
loadFromMergeinfoProperty
(java.lang.String mergeinfo) Parse thesvn:mergeinfo
property to populate the merge source URLs and revision ranges of this instance.private void
parseMergeinfoLine
(java.lang.String line) Parse a merge source line from asvn:mergeinfo
property value (e.g.private void
parseRevisions
(java.lang.String path, java.lang.String revisions) Parse the revisions in a merge info line into RevisionRange objects and adds each of them to the internal Map (e.g.private void
setRevisionList
(java.lang.String mergeSrc, java.util.List<RevisionRange> range) Add the List object to the map.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
mergeSources
A mapping of repository-relative paths to a list of revision ranges.
-
-
Constructor Details
-
Mergeinfo
public Mergeinfo() -
Mergeinfo
public Mergeinfo(java.lang.String mergeinfo) Create and populate an instance using the contents of thesvn:mergeinfo
property.- Parameters:
mergeinfo
-svn:mergeinfo
property value.
-
Mergeinfo
A constructor for backward compat.
-
-
Method Details
-
addRevisions
Add one or more RevisionRange objects to merge info. If the merge source is already stored, the list of revisions is replaced.- Parameters:
mergeSrc
- The merge source URL.ranges
- RevisionRange objects to add.- Throws:
SubversionException
- If range list contains objects of type other than RevisionRange.
-
addRevisionRange
Add a revision range to the merged revisions for a path. If the merge source already has associated revision ranges, add the revision range to the existing list.- Parameters:
mergeSrc
- The merge source URL.range
- The revision range to add.
-
getPaths
public java.lang.String[] getPaths()Get the merge source URLs.- Returns:
- The merge source URLs.
-
getRevisions
Get the revision ranges for the specified merge source URL.- Parameters:
mergeSrc
- The merge source URL, ornull
.- Returns:
- List of RevisionRange objects, or
null
.
-
getRevisionRange
Get the RevisionRange objects for the specified merge source URL- Parameters:
mergeSrc
- The merge source URL, ornull
.- Returns:
- Array of RevisionRange objects, or
null
.
-
loadFromMergeinfoProperty
public void loadFromMergeinfoProperty(java.lang.String mergeinfo) Parse thesvn:mergeinfo
property to populate the merge source URLs and revision ranges of this instance.- Parameters:
mergeinfo
-svn:mergeinfo
property value.
-
parseMergeinfoLine
private void parseMergeinfoLine(java.lang.String line) Parse a merge source line from asvn:mergeinfo
property value (e.g."/trunk:1-100,104,108,110-115"
).- Parameters:
line
- A line of merge info for a single merge source.
-
parseRevisions
private void parseRevisions(java.lang.String path, java.lang.String revisions) Parse the revisions in a merge info line into RevisionRange objects and adds each of them to the internal Map (e.g."1-100,104,108,110-115"
)- Parameters:
path
- The merge source path.revisions
- A textual representation of the revision ranges.
-
setRevisionList
Add the List object to the map. This method is only used internally where we know that List contains a type-safe set of RevisionRange objects.- Parameters:
mergeSrc
- The merge source URL.range
- List of RevisionRange objects to add.
-