mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-13 08:55:44 +01:00
remove leading slash from svn modification paths
This commit is contained in:
@@ -90,35 +90,6 @@ public class SvnUtil
|
|||||||
appendModification(modifications, entry.getType(), entry.getPath());
|
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
|
* Method description
|
||||||
*
|
*
|
||||||
@@ -130,6 +101,11 @@ public class SvnUtil
|
|||||||
public static void appendModification(Modifications modifications, char type,
|
public static void appendModification(Modifications modifications, char type,
|
||||||
String path)
|
String path)
|
||||||
{
|
{
|
||||||
|
if (path.startsWith("/"))
|
||||||
|
{
|
||||||
|
path = path.substring(1);
|
||||||
|
}
|
||||||
|
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case SVNLogEntryPath.TYPE_ADDED :
|
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