예제 #1
0
        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;
                }
            }
        }
예제 #2
0
 public ModificationMappingExpression(
     IRepositoryMappingExpression parentExp,
     TouchedFileAction action)
     : base(parentExp)
 {
     entity = new Modification()
     {
         Action = action,
         Commit = CurrentEntity <Commit>(),
         File   = CurrentEntity <CodeFile>(),
     };
     Add(entity);
 }
예제 #3
0
 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,
     });
 }
예제 #4
0
        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;
            }
        }