Пример #1
0
 public BranchMappingExpression(IRepositoryMappingExpression parentExp)
     : base(parentExp)
 {
     entity = NewBranch(null, true, false);
     Add(entity);
     entity.Commits.Add(CurrentEntity <Commit>());
 }
 public CommitMappingExpression(IRepositoryMappingExpression parentExp, string revision)
     : base(parentExp)
 {
     entity = new Commit();
     entity.OrderedNumber = Queryable <Commit>().Count() + 1;
     entity.Revision      = revision;
     AddEntity();
 }
 public static CommitMappingExpression Commit(this IRepositoryMappingExpression exp, string revision)
 {
     return(new CommitMappingExpression(
                exp,
                exp.Queryable <Commit>().Single(x =>
                                                x.Revision == revision
                                                )
                ));
 }
Пример #4
0
 public BugFixMappingExpression(IRepositoryMappingExpression parentExp)
     : base(parentExp)
 {
     entity = new BugFix()
     {
         Commit = CurrentEntity <Commit>()
     };
     AddEntity();
 }
 public ReleaseMappingExpression(IRepositoryMappingExpression parentExp, string tag)
     : base(parentExp)
 {
     entity = new Release()
     {
         Commit = CurrentEntity <Commit>(),
         Tag    = tag
     };
     AddEntity();
 }
Пример #6
0
 public ModificationMappingExpression(IRepositoryMappingExpression parentExp)
     : base(parentExp)
 {
     entity = new Modification()
     {
         Commit = CurrentEntity <Commit>(),
         File   = CurrentEntity <ProjectFile>()
     };
     AddEntity();
 }
Пример #7
0
 public BugFixMappingExpression(IRepositoryMappingExpression parentExp)
     : base(parentExp)
 {
     entity = new CommitAttribute()
     {
         Type   = CommitAttribute.FIX,
         Commit = CurrentEntity <Commit>()
     };
     Add(entity);
 }
Пример #8
0
 public ProjectFileMappingExpression(IRepositoryMappingExpression parentExp, string filePath)
     : base(parentExp)
 {
     entity = new ProjectFile()
     {
         Path          = filePath,
         AddedInCommit = CurrentEntity <Commit>()
     };
     AddEntity();
 }
Пример #9
0
 public TagMappingExpression(IRepositoryMappingExpression parentExp, string title)
     : base(parentExp)
 {
     entity = new CommitAttribute()
     {
         Type   = CommitAttribute.TAG,
         Data   = title,
         Commit = CurrentEntity <Commit>()
     };
     Add(entity);
 }
Пример #10
0
 public CommitAttributeMappingExpression(
     IRepositoryMappingExpression parentExp, string type, string data)
     : base(parentExp)
 {
     entity = new CommitAttribute()
     {
         Type   = type,
         Data   = data,
         Commit = CurrentEntity <Commit>()
     };
     Add(entity);
 }
Пример #11
0
 public ModificationMappingExpression(
     IRepositoryMappingExpression parentExp,
     string sourseFilePath,
     string sourceRevision)
     : this(parentExp, TouchedFileAction.ADDED)
 {
     entity.SourceCommit = Get <Commit>()
                           .Single(x => x.Revision == sourceRevision);
     // use DSL to make additional check that file exists in the revision
     entity.SourceFile = this.SelectionDSL(true)
                         .Files().PathIs(sourseFilePath).ExistInRevision(sourceRevision).Single();
 }
Пример #12
0
 public ModificationMappingExpression(
     IRepositoryMappingExpression parentExp,
     TouchedFileAction action)
     : base(parentExp)
 {
     entity = new Modification()
     {
         Action = action,
         Commit = CurrentEntity <Commit>(),
         File   = CurrentEntity <CodeFile>(),
     };
     Add(entity);
 }
Пример #13
0
 public CodeBlockMappingExpression(IRepositoryMappingExpression parentExp, double size)
     : base(parentExp)
 {
     entity = new CodeBlock()
     {
         Size         = size,
         Modification = CurrentEntity <Modification>(),
     };
     if (size > 0)
     {
         entity.AddedInitiallyInCommit = CurrentEntity <Commit>();
     }
     Add(entity);
 }
Пример #14
0
 public CodeFileMappingExpression(IRepositoryMappingExpression parentExp, string filePath)
     : base(parentExp)
 {
     entity = parentExp.Get <CodeFile>()
              .Where(f => f.Path == filePath).SingleOrDefault();
     if (entity == null)
     {
         entity = new CodeFile()
         {
             Path = filePath
         };
         Add(entity);
     }
 }
Пример #15
0
 public AuthorMappingExpression(
     IRepositoryMappingExpression parentExp,
     string name)
     : base(parentExp)
 {
     entity = Get <Author>().SingleOrDefault(a => a.Name == name);
     if (entity == null)
     {
         entity = new Author()
         {
             Name = name,
         };
         Add(entity);
     }
     entity.Commits.Add(CurrentEntity <Commit>());
 }
Пример #16
0
 public void MapRevision(string revision)
 {
     using (var s = data.OpenSession())
     {
         IEnumerable <IRepositoryMappingExpression> expressions =
             new IRepositoryMappingExpression[]
         {
             new RepositoryMappingExpression(s)
             {
                 Revision = revision
             }
         };
         foreach (var mapper in mappers)
         {
             var newExpressions = mapper(expressions);
             if (newExpressions.Count() > 0)
             {
                 expressions = newExpressions;
             }
         }
         s.SubmitChanges();
     }
 }
Пример #17
0
 public BranchMappingExpression(
     IRepositoryMappingExpression parentExp,
     BranchMask mask,
     bool subBranch)
     : base(parentExp)
 {
     entity = Get <Branch>()
              .SingleOrDefault(b => b.Mask.Data == mask.Data && b.Mask.Offset == mask.Offset);
     if (entity == null)
     {
         entity = NewBranch(mask, subBranch, subBranch);
         Add(entity);
     }
     else
     {
         if (subBranch)
         {
             entity = NewBranch(mask, true, true);
             Add(entity);
         }
     }
     entity.Commits.Add(CurrentEntity <Commit>());
 }
 public static CommitMappingExpression AddCommit(this IRepositoryMappingExpression exp, string revision)
 {
     return(new CommitMappingExpression(exp, revision));
 }
 public CommitMappingExpression(IRepositoryMappingExpression parentExp, Commit commit)
     : base(parentExp)
 {
     entity = commit;
 }
Пример #20
0
 public ProjectFileMappingExpression(IRepositoryMappingExpression parentExp, ProjectFile file)
     : base(parentExp)
 {
     entity = file;
 }
Пример #21
0
 public EntityMappingExpression(IRepositoryMappingExpression parentExp)
 {
     this.parentExp = parentExp;
 }