Exemplo n.º 1
0
        public void Append(RevisionId revisionId, PathPair path, FileHistoryEntry historyEntry)
        {
            string fileId;

            if (historyEntry.FileId != Guid.Empty)
            {
                fileId = historyEntry.FileId.ToString();
            }
            else
            {
                fileId = "PROV_" + Convert.ToBase64String(Encoding.UTF8.GetBytes($"{path.OldPath}\0{path.NewPath}"));
            }

            var matrixEntry = Find(x => x.FileId == fileId);

            if (matrixEntry == null)
            {
                matrixEntry = new Entry(_revisions)
                {
                    FileId = fileId
                };
                Add(matrixEntry);
            }

            matrixEntry.Revisions[revisionId] = Status.From(path, historyEntry);
        }
Exemplo n.º 2
0
 public static Status From(PathPair path, FileHistoryEntry historyEntry) => new Status
 {
     File        = path,
     IsNew       = historyEntry.IsNew,
     IsRenamed   = historyEntry.IsRenamed,
     IsDeleted   = historyEntry.IsDeleted,
     IsUnchanged = !historyEntry.IsModified,
 };