private void ProcessItem(VssItem item, string path, PathMatcher exclusionMatcher)
{
try
{
VssRevision previousRevision = null;
LinkedList <VssRevision> revisions = new LinkedList <VssRevision>();
IEnumerable <VssRevision> originalRevisions = item.Revisions; // this is recreated from the file each time it is queried!!!
foreach (VssRevision vssRevision in originalRevisions)
{
if (previousRevision != null)
{
checkRevisionTime(item, previousRevision, vssRevision);
}
previousRevision = vssRevision;
revisions.AddLast(vssRevision);
}
foreach (VssRevision vssRevision in revisions)
{
var actionType = vssRevision.Action.Type;
var namedAction = vssRevision.Action as VssNamedAction;
if (namedAction != null)
{
if (actionType == VssActionType.Destroy)
{
// track destroyed files so missing history can be anticipated
// (note that Destroy actions on shared files simply delete
// that copy, so destroyed files can't be completely ignored)
destroyedFiles.Add(namedAction.Name.PhysicalName);
}
var targetPath = path + VssDatabase.ProjectSeparator + namedAction.Name.LogicalName;
if (exclusionMatcher != null && exclusionMatcher.Matches(targetPath))
{
// project action targets an excluded file
continue;
}
}
Revision revision = new Revision(vssRevision.DateTime,
vssRevision.User, item.ItemName, vssRevision.Version,
vssRevision.Comment, vssRevision.Action);
ICollection <Revision> revisionSet;
if (!sortedRevisions.TryGetValue(vssRevision.DateTime, out revisionSet))
{
revisionSet = new LinkedList <Revision>();
sortedRevisions[vssRevision.DateTime] = revisionSet;
}
revisionSet.Add(revision);
++revisionCount;
}
}
catch (RecordException e)
{
var message = string.Format("Failed to read revisions for {0} ({1}): {2}",
path, item.PhysicalName, ExceptionFormatter.Format(e));
LogException(e, message);
ReportError(message);
}
}