Example #1
0
        private bool CommitChangeset(Changeset changeset)
        {
            var result = false;

            AbortRetryIgnore(delegate
            {
                string comment = changeset.Comment;
                if (string.IsNullOrWhiteSpace(comment))
                {
                    if (this.tryGenerateCommitMessage)
                    {
                        comment = (ChangesetCommentBuilder.GetComment(changeset) ?? DefaultComment);
                    }
                    else
                    {
                        comment = DefaultComment;
                    }
                }
                result = vcsWrapper.AddAll() &&
                         vcsWrapper.Commit(GetUsername(changeset.User), GetEmail(changeset.User), comment, changeset.DateTime);
            });
            return(result);
        }
        public static string GetComment(Changeset changeset)
        {
            if (object.ReferenceEquals(changeset, null))
            {
                return(null);
            }
            ChangesetCommentBuilder cb = new ChangesetCommentBuilder();

            foreach (Revision revision in changeset.Revisions)
            {
                if (revision.Item.IsProject)
                {
                    cb.Add(revision.Action.Type);
                }
            }
            if (cb.Count > 0)
            {
                return(cb.ToString());
            }
            else
            {
                return(null);
            }
        }