private void CreateRevision(string revname) { Revision n = new Revision() { name = revname, creation = DateTime.Now, }; AllRevisions.Add(n); openRev = n; }
public void RecalcInterestingFiles(Revision rev) { rev.InterestingFiles.Clear(); string[] itTags = rev.GetITTags(); foreach (string s in RevTable.Keys) { if (RevTable[s].revisions.ContainsKey(rev.name)) { foreach (string tag in itTags) { if (s.Contains(tag, StringComparison.OrdinalIgnoreCase)) rev.MarkInterestingFile(s); } } } }
public void OpenRevision(string name) { Revision rev = AllRevisions.Where(c => c.name == name).DefaultIfEmpty(None).FirstOrDefault(); if (rev.CompareTo(None) == 0) CreateRevision(name); else openRev = rev; foreach (FileEntry e in RevTable.Values) { e.touched = false; } }
public string GetFilesForRevision(Revision rev) { StringBuilder builder = new StringBuilder(); builder.AppendLine("Revision Report for " + rev.name); builder.AppendLine(); int countmod = 0; foreach (string s in RevTable.Where(x => x.Value.revisions.ContainsKey(rev.name) && x.Value.revisions[rev.name].action == RevisionAction.MODIFY).Select(x => x.Key).OrderBy(x=> x)) { builder.AppendLine(string.Format("{0} \t\t {1}", RevTable[s].revisions[rev.name].action.ToString(), s)); countmod++; } int countadd = 0; foreach (string s in RevTable.Where(x => x.Value.revisions.ContainsKey(rev.name) && x.Value.revisions[rev.name].action == RevisionAction.ADD).Select(x => x.Key).OrderBy(x => x)) { builder.AppendLine(string.Format("{0} \t\t {1}", RevTable[s].revisions[rev.name].action.ToString(), s)); countadd++; } int countremove = 0; foreach (string s in RevTable.Where(x => x.Value.revisions.ContainsKey(rev.name) && x.Value.revisions[rev.name].action == RevisionAction.REMOVE).Select(x => x.Key).OrderBy(x => x)) { builder.AppendLine(string.Format("{0} \t\t {1}", RevTable[s].revisions[rev.name].action.ToString(), s)); countremove++; } builder.AppendLine(); builder.AppendLine("Total Files Changed: " + (countadd + countmod + countremove)); builder.AppendLine("Total Files Modified: " + countmod); builder.AppendLine("Total Files Added: " + countadd); builder.AppendLine("Total Files Removed: " + countremove); return builder.ToString().Trim(); }
public bool DeleteRevision(Revision rev) { if (!AllRevisions.Contains(rev)) return false; AllRevisions.Remove(rev); foreach (FileEntry entry in RevTable.Values) { if(entry.revisions.ContainsKey(rev.ToString())) { entry.revisions.Remove(rev.ToString()); } } CleanOrphanedFiles(); return true; }
public void CloseRevision() { openRev = null; }