Esempio n. 1
0
 static CommentWrapper CalcComment(CommitItem item, string author, string token) {
     CommentWrapper comment = new CommentWrapper();
     comment.TimeStamp = item.TimeStamp.Ticks.ToString();
     comment.Author = author;
     comment.Branch = item.Track.Branch;
     comment.Token = token;
     if (item.Items.Any(x => !string.IsNullOrEmpty(x.Comment) && CommentWrapper.IsAutoSyncComment(x.Comment)))
         comment.Comment = item.Items.Select(x => CommentWrapper.Parse(x.Comment ?? x.Message).Comment).FirstOrDefault(x => !string.IsNullOrEmpty(x));
     else
         comment.Comment = item.Items.FirstOrDefault(x => !string.IsNullOrEmpty(x.Comment))?.Comment;
     return comment;
 }
Esempio n. 2
0
 static CommentWrapper CalcComment(MergeRequest mergeRequest, TrackBranch branch, string autoSyncToken) {
     CommentWrapper comment = new CommentWrapper();
     comment.Author = mergeRequest.Author.Username;
     comment.Branch = branch.Name;
     comment.Token = autoSyncToken;
     comment.Comment = CalcCommentForMergeRequest(mergeRequest);
     return comment;
 }