remove leading slash from svn modification paths

This commit is contained in:
Sebastian Sdorra
2012-06-13 11:39:57 +02:00
parent 56452e9de7
commit 090dfdaaa9

View File

@@ -89,35 +89,6 @@ public class SvnUtil
{
appendModification(modifications, entry.getType(), entry.getPath());
}
/**
* Method description
*
*
* @param revision
*
* @return
*
* @throws RepositoryException
*/
public static long getRevisionNumber(String revision) throws RepositoryException
{
long revisionNumber = -1;
if (Util.isNotEmpty(revision))
{
try
{
revisionNumber = Long.parseLong(revision);
}
catch (NumberFormatException ex)
{
throw new RepositoryException("given revision is not a svnrevision");
}
}
return revisionNumber;
}
/**
* Method description
@@ -130,6 +101,11 @@ public class SvnUtil
public static void appendModification(Modifications modifications, char type,
String path)
{
if (path.startsWith("/"))
{
path = path.substring(1);
}
switch (type)
{
case SVNLogEntryPath.TYPE_ADDED :
@@ -227,4 +203,36 @@ public class SvnUtil
}
}
}
//~--- get methods ----------------------------------------------------------
/**
* Method description
*
*
* @param revision
*
* @return
*
* @throws RepositoryException
*/
public static long getRevisionNumber(String revision)
throws RepositoryException
{
long revisionNumber = -1;
if (Util.isNotEmpty(revision))
{
try
{
revisionNumber = Long.parseLong(revision);
}
catch (NumberFormatException ex)
{
throw new RepositoryException("given revision is not a svnrevision");
}
}
return revisionNumber;
}
}