コード例 #1
0
ファイル: VcsExporter.cs プロジェクト: pokke123/vss2git
        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);
        }
コード例 #2
0
        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);
            }
        }