public static CodeBlockMappingExpression RemoveCode(this IModificationMappingExpression exp) { var file = exp.CurrentEntity <CodeFile>(); var currentCommitBranch = exp.CurrentEntity <Branch>(); var commitsOnBranch = exp.SelectionDSL().Commits() .OnBranchBack(currentCommitBranch.Mask); return(DoWithRemainingCode( exp, commitsOnBranch, file.Id, RemoveCodeBlock)); }
public static CodeBlockMappingExpression UpdateCode( this IModificationMappingExpression exp, Func <IModificationMappingExpression, string, double, CodeBlockMappingExpression> codeToExp) { var file = exp.CurrentEntity <CodeFile>(); var currentCommitBranch = exp.CurrentEntity <Branch>(); var commitsOnBranch = exp.SelectionDSL().Commits() .OnBranchBack(currentCommitBranch.Mask); return(DoWithRemainingCode( exp, commitsOnBranch, file.Id, codeToExp)); }
public static CodeBlockMappingExpression CopyCode(this IModificationMappingExpression exp) { var modification = exp.CurrentEntity <Modification>(); var sourceCommit = ( from c in exp.GetReadOnly <Commit>().Where(x => x.Number == modification.SourceCommit.Number) join b in exp.GetReadOnly <Branch>() on c.BranchId equals b.Id select new { c.Number, b.Mask }).Single(); var commitsOnBranch = exp.SelectionDSL().Commits() .OnBranchBack(sourceCommit.Mask) .Where(x => x.Number <= sourceCommit.Number); return(DoWithRemainingCode( exp, commitsOnBranch, modification.SourceFile.Id, CopyCodeBlock)); }