Modifications in VssConnection:.java:
Fix bug when vss project specified in the scm connection string ended with '/'. In that case we got an exception 'String out of range : -1'
=========================================
BEFORE:
vssProject = splitedConnection[4];
NOW:
vssProject = splitedConnection[4];
if(vssProject.lastIndexOf("/") == vssProject.length() - 1)
{
vssProject = vssProject.substring(0, vssProject.length() - 1);
}
Modifications in VssChangeLogParser:.java:
Patch submitted with issue 'MPCHANGELOG-65' to fix bug when vss history feed contained label items didn't pass junit tests.
=========================================
BEFORE:
private static final String START_FILE = "***** "
NOW:
private static final String START_FILE = "****";
BEFORE:
setCurrentFile(new ChangeLogFile(fileLine[2]));
NOW:
if (fileLine.length > 2)
{
setCurrentFile(new ChangeLogFile(fileLine[2]));
}
Modifications in VssChangeLogParser:.java:
Solve regional setting issue (MPCHANGELOG-65)
=========================================
BEFORE:
entry.setDate(parseDate((String) vector.get(3) + " "
+ (String) vector.get(5)));
NOW:
String date = (String) vector.get(3);
String time = (String) vector.get(5);
time = time.replaceAll("a", "AM");
time = time.replaceAll("p", "PM");
entry.setDate(parseDate(date
+ " " + time));
BEFORE:
SimpleDateFormat format = new SimpleDateFormat("dd.MM.yy HH:mm");
NOW:
SimpleDateFormat format = getLocalVssDateFormat();
BEFORE:
try
{
SimpleDateFormat format = new SimpleDateFormat("dd.MM.yy HH:mm");
Date date = format.parse(dateString);
return date;
}
catch (ParseException e)
{
LOG.error("ParseException Caught", e);
return null;
}
NOW:
try
{
SimpleDateFormat format = getLocalVssDateFormat();
Date date = format.parse(dateString);
return date;
}
catch (ParseException e)
{
throw new RuntimeException(
"VSS date : '"
+ dateString
+ "' doesn't match following date format : '"
+ getLocalVssDateFormat().toPattern()
+ "'. Please specify appropriate date format with 'maven.changelog.vsslib.dateFormat' property.",
e);
}
/**
- Vss client format history feed is based on the regional settings of the
- machine. There's no way to get the pattern that is set on the system's
- settings (expect through JNI calls). The default format 'MM/dd/yy h:mma'
- correspond to en_US regional settings. This format can be overwritten
- with property 'maven.changelog.vsslib.dateFormat'.
*/
private SimpleDateFormat getLocalVssDateFormat()
Unknown macro: { String dateFormat = null; try {
org.apache.maven.jelly.MavenJellyContext mavenJellyContext = org.apache.maven.MavenUtils
.createContext(new java.io.File("."));
dateFormat = (String) mavenJellyContext
.getVariable("maven.changelog.vsslib.dateFormat");
} catch (Exception e) {
logger.debug("Unexpected error occurred when trying to read"
+ " 'maven.changelog.vsslib.dateFormat' property", e);
} if (dateFormat == null) {
dateFormat = "MM/dd/yy h:mma";
} return new SimpleDateFormat(dateFormat); }
can you please include this as a diff against the latest version from subversion?
Thanks.