use of teamdash.wbs.ChangeHistory.Entry in project processdash by dtuma.
the class ProjectHistoryBridgedAbstract method initTimeDelta.
protected void initTimeDelta(ManifestEntry changeHist) {
// these back to UTC timestamps.
if (timeDelta == 0 && changeHist != null) {
try {
Element xml = parseXml(changeHist.getStream());
ChangeHistory changes = new ChangeHistory(xml);
Entry lastChange = changes.getLastEntry();
long lastTimestamp = lastChange.getTimestamp().getTime();
timeDelta = changeHist.lastMod - lastTimestamp;
// the file modification time can normally differ from the
// change timestamp by a second or two; but we are only
// interested in the delta caused by time zone differences.
// round the delta to an even half-hour interval.
double fraction = timeDelta / (30.0 * DateUtils.MINUTES);
timeDelta = (int) Math.round(fraction) * 30 * DateUtils.MINUTES;
} catch (Exception e) {
}
}
}
use of teamdash.wbs.ChangeHistory.Entry in project processdash by dtuma.
the class TeamProjectMergeCoordinator method recordMergedChangeHistoryEntries.
private void recordMergedChangeHistoryEntries() {
ChangeHistory baseChanges = new ChangeHistory(baseDir.getDirectory());
ChangeHistory mainChanges = new ChangeHistory(mainDir.getDirectory());
Entry lastBaseChange = baseChanges.getLastEntry();
if (lastBaseChange == null)
return;
String lastBaseChangeUid = lastBaseChange.getUid();
boolean sawLastBaseChange = false;
for (Entry mainChange : mainChanges.getEntries()) {
if (sawLastBaseChange)
mergedChanges.add(mainChange);
else if (mainChange.getUid().equals(lastBaseChangeUid))
sawLastBaseChange = true;
}
}
Aggregations