public TestLog FileRemoved( string path, TouchedFile.ContentType type = TouchedFile.ContentType.UNKNOWN) { TouchPath(path, TouchedFileAction.REMOVED, null, null, type); return(this); }
public TestLog FileModified( string path, TouchedFile.ContentType type = TouchedFile.ContentType.UNKNOWN) { TouchPath(path, TouchedFileAction.MODIFIED, null, null, type); return(this); }
protected void AddOrModifyTouchedFile( TouchedFileAction action, string path, string sourcePath, TouchedFile.ContentType type) { path = GitPathToPath(path); sourcePath = GitPathToPath(sourcePath); var touchedFile = touchedFiles.Where(x => x.Path == path).SingleOrDefault(); if (touchedFile == null) { touchedFiles.Add(new TouchedFile() { Path = path, Action = action, SourcePath = sourcePath, Type = type, }); } else { if (touchedFile.Action == TouchedFileAction.MODIFIED && action != TouchedFileAction.MODIFIED) { touchedFile.Action = action; } } }
protected void MapTouchedFile( TouchedFileGitAction action, string path, string sourcePath, TouchedFile.ContentType type, Action <TouchedFileAction, string, string, TouchedFile.ContentType> touchedFileMapper) { switch (action) { case TouchedFileGitAction.MODIFIED: touchedFileMapper(TouchedFileAction.MODIFIED, path, sourcePath, type); break; case TouchedFileGitAction.ADDED: touchedFileMapper(TouchedFileAction.ADDED, path, sourcePath, type); break; case TouchedFileGitAction.DELETED: touchedFileMapper(TouchedFileAction.REMOVED, path, sourcePath, type); break; case TouchedFileGitAction.RENAMED: touchedFileMapper(TouchedFileAction.REMOVED, sourcePath, null, type); touchedFileMapper(TouchedFileAction.ADDED, path, sourcePath, type); break; case TouchedFileGitAction.COPIED: touchedFileMapper(TouchedFileAction.ADDED, path, sourcePath, type); break; default: break; } }
public TestLog FileRenamed( string path, string sourcePath, TouchedFile.ContentType type = TouchedFile.ContentType.UNKNOWN) { FileRemoved(sourcePath, type); FileCopied(path, sourcePath, null, type); return(this); }
public TestLog FileCopied( string path, string sourcePath, string sourceRevision, TouchedFile.ContentType type = TouchedFile.ContentType.UNKNOWN) { TouchPath(path, TouchedFileAction.ADDED, sourcePath, sourceRevision, type); return(this); }
private void TouchPath( string path, TouchedFileAction action, string sourcePath, string sourceRevision, TouchedFile.ContentType type) { touchedFiles.Add(new TouchedFile() { Path = path, Action = action, SourcePath = sourcePath, SourceRevision = sourceRevision, Type = type, }); }
protected void ModifyTouchedFile( TouchedFileAction action, string path, string sourcePath, TouchedFile.ContentType type) { path = GitPathToPath(path); sourcePath = GitPathToPath(sourcePath); var touchedFile = touchedFiles.SingleOrDefault(x => x.Path == path); if (touchedFile != null) { touchedFile.Action = action; touchedFile.SourcePath = sourcePath; touchedFile.Type = type; } }