mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-06 21:45:43 +01:00
remove leading slash from svn modification paths
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user