コード例 #1
0
        public override string ToString(BotElement bot, Func <string, string> transform)
        {
            string formattedTime = String.IsNullOrEmpty(bot.Text.DateTimeFormat) ? AuthorTime.ToString() : AuthorTime.ToString(bot.Text.DateTimeFormat);
            var    sb            = new StringBuilder();

            if (RefNames != null)
            {
                sb.AppendFormat("{0} ", transform(String.Concat(RefNames)));
            }

            sb.Append(bot.Text.CommitFormat.FormatWith(new
            {
                Action       = Type == CommitRowType.Commit ? bot.Text.Commit : bot.Text.RefPointer,
                CommitUri    = CommitUri,
                CommitId     = transform(CommitId.ToHexString(settings.HashLength)),
                ChangeCounts = (ChangeCounts != null) ? String.Join(", ", ChangeCounts.Select(c => ChangeCountToString(bot, c))) : "",
                AuthorTime   = formattedTime,
                Author       = transform(Author),
                AuthorName   = transform(AuthorName),
                AuthorEmail  = transform(AuthorEmail),
                Comment      = transform(Comment.Truncate(settings.CommentMaxLength))
            }));

            return(sb.ToString());
        }
コード例 #2
0
        public override string ToString()
        {
            StringBuilder toStringValue = new StringBuilder();

            toStringValue.AppendLine("Author: " + Author);
            toStringValue.AppendLine("AuthorTime: " + AuthorTime.ToString());
            toStringValue.AppendLine("Committer: " + Committer);
            toStringValue.AppendLine("CommitterTime: " + CommitterTime.ToString());
            toStringValue.AppendLine("Summary: " + Summary);
            toStringValue.AppendLine();
            toStringValue.AppendLine("FileName: " + FileName);

            return(toStringValue.ToString().Trim());
        }
コード例 #3
0
ファイル: GitBlame.cs プロジェクト: yeerwu/gitextensions
        public override string ToString()
        {
            var s = new StringBuilder();

            s.Append("Author: ").AppendLine(Author);
            s.Append("AuthorTime: ").AppendLine(AuthorTime.ToString(CultureInfo.CurrentCulture));
            s.Append("Committer: ").AppendLine(Committer);
            s.Append("CommitterTime: ").AppendLine(CommitterTime.ToString(CultureInfo.CurrentCulture));
            s.Append("Summary: ").AppendLine(Summary);
            s.AppendLine();
            s.Append("FileName: ").Append(FileName);

            return(s.ToString());
        }
コード例 #4
0
 /// <summary>
 /// Dumps the revision data is debug output is enabled.
 /// </summary>
 public void DumpData()
 {
     Program.ShowDebugMessage("Revision data:");
     Program.ShowDebugMessage("  AuthorEMail: " + AuthorEMail);
     Program.ShowDebugMessage("  AuthorName: " + AuthorName);
     Program.ShowDebugMessage("  AuthorTime: " + AuthorTime.ToString("yyyy-MM-dd HH:mm:ss K"));
     Program.ShowDebugMessage("  Branch: " + Branch);
     Program.ShowDebugMessage("  CommitHash: " + CommitHash);
     Program.ShowDebugMessage("  CommitterEMail: " + CommitterEMail);
     Program.ShowDebugMessage("  CommitterName: " + CommitterName);
     Program.ShowDebugMessage("  CommitTime: " + CommitTime.ToString("yyyy-MM-dd HH:mm:ss K"));
     Program.ShowDebugMessage("  IsMixed: " + IsMixed);
     Program.ShowDebugMessage("  IsModified: " + IsModified);
     Program.ShowDebugMessage("  RepositoryUrl: " + RepositoryUrl);
     Program.ShowDebugMessage("  RevisionNumber: " + RevisionNumber);
     Program.ShowDebugMessage("  VcsProvider: " + VcsProvider);
 }
コード例 #5
0
 /// <summary>
 /// Dumps the revision data is debug output is enabled.
 /// </summary>
 /// <param name="logger">A logger.</param>
 public void DumpData(ILogger logger)
 {
     logger.Trace("Revision data:");
     logger.Trace("  AuthorEMail: " + AuthorEMail);
     logger.Trace("  AuthorName: " + AuthorName);
     logger.Trace("  AuthorTime: " + AuthorTime.ToString("yyyy-MM-dd HH:mm:ss K"));
     logger.Trace("  Branch: " + Branch);
     logger.Trace("  CommitHash: " + CommitHash);
     logger.Trace("  CommitterEMail: " + CommitterEMail);
     logger.Trace("  CommitterName: " + CommitterName);
     logger.Trace("  CommitTime: " + CommitTime.ToString("yyyy-MM-dd HH:mm:ss K"));
     logger.Trace("  IsMixed: " + IsMixed);
     logger.Trace("  IsModified: " + IsModified);
     logger.Trace("  RepositoryUrl: " + RepositoryUrl);
     logger.Trace("  RevisionNumber: " + RevisionNumber);
     logger.Trace("  Tag: " + Tag + " + " + CommitsAfterTag);
     logger.Trace("  VcsProvider: " + VcsProvider);
 }
コード例 #6
0
        public override string ToString()
        {
            StringBuilder s = new();

            s.Append("Author: ").AppendLine(Author);
            s.Append("Author date: ").AppendLine(AuthorTime.ToString(CultureInfo.CurrentCulture));
            if (Author != Committer || AuthorTime != CommitterTime)
            {
                s.Append("Committer: ").AppendLine(Committer);
                s.Append("Commit date: ").AppendLine(CommitterTime.ToString(CultureInfo.CurrentCulture));
            }

            s.Append("Commit hash: ").AppendLine(ObjectId.ToShortString());
            s.Append("Summary: ").AppendLine(Summary);
            s.AppendLine();
            s.Append("FileName: ").Append(FileName);

            return(s.ToString());
        }
コード例 #7
0
        public override string ToString(BotElement bot, TextElement text, Func <string, string> transform)
        {
            string formattedTime = string.IsNullOrEmpty(text.DateTimeFormat) ? AuthorTime.ToString() : AuthorTime.ToString(text.DateTimeFormat);
            var    sb            = new StringBuilder();

            if (Refs != null)
            {
                sb.AppendFormat("{0} ", Refs.ToString(text, transform));
            }

            sb.Append(text.CommitFormat.FormatWith(new
            {
                Action       = Type == CommitRowType.Commit ? text.Commit : text.RefPointer, CommitUri,
                CommitId     = transform(CommitId.ToHexString(Settings.HashLength)),
                ChangeCounts = (ChangeCounts != null) ? ChangeCountsToString(text, ChangeCounts) : "",
                AuthorTime   = formattedTime,
                Author       = transform(Author),
                AuthorName   = transform(AuthorName),
                AuthorEmail  = transform(AuthorEmail),
                Comment      = transform(Comment.Truncate(Settings.CommentMaxLength, true))
            }));

            return(sb.ToString());
        }