当前位置: 首页>>代码示例>>C#>>正文


C# Core.LogEntry类代码示例

本文整理汇总了C#中Sep.Git.Tfs.Core.LogEntry的典型用法代码示例。如果您正苦于以下问题:C# LogEntry类的具体用法?C# LogEntry怎么用?C# LogEntry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


LogEntry类属于Sep.Git.Tfs.Core命名空间,在下文中一共展示了LogEntry类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: WithCommitHeaderEnv

 //private Encoding LookupEncoding(string encoding)
 //{
 //    if(encoding == null)
 //        return null;
 //    throw new NotImplementedException("Need to implement encoding lookup for " + encoding);
 //}
 private void WithCommitHeaderEnv(LogEntry logEntry, Action action)
 {
     WithTemporaryEnvironment(action, new Dictionary<string, string>
                                          {
                                              {"GIT_AUTHOR_NAME", logEntry.AuthorName},
                                              {"GIT_AUTHOR_EMAIL", logEntry.AuthorEmail},
                                              {"GIT_AUTHOR_DATE", logEntry.Date.FormatForGit()},
                                              {"GIT_COMMITTER_DATE", logEntry.Date.FormatForGit()},
                                              {"GIT_COMMITTER_NAME", logEntry.CommitterName ?? logEntry.AuthorName},
                                              {"GIT_COMMITTER_EMAIL", logEntry.CommitterEmail ?? logEntry.AuthorEmail}
                                          });
 }
开发者ID:roend83,项目名称:git-tfs,代码行数:18,代码来源:GitTfsRemote.cs

示例2: WriteCommit

 private string WriteCommit(LogEntry logEntry)
 {
     // TODO (maybe): encode logEntry.Log according to 'git config --get i18n.commitencoding', if specified
     //var commitEncoding = Repository.CommandOneline("config", "i18n.commitencoding");
     //var encoding = LookupEncoding(commitEncoding) ?? Encoding.UTF8;
     string commitHash = null;
     Repository.CommandInputOutputPipe((procIn, procOut) =>
                                           {
                                               procIn.WriteLine(logEntry.Log);
                                               procIn.WriteLine(GitTfsConstants.TfsCommitInfoFormat, TfsUrl,
                                                                TfsRepositoryPath, logEntry.ChangesetId);
                                               procIn.Close();
                                               commitHash = ParseCommitInfo(procOut.ReadToEnd());
                                           }, BuildCommitCommand(logEntry));
     return commitHash;
 }
开发者ID:roend83,项目名称:git-tfs,代码行数:16,代码来源:GitTfsRemote.cs

示例3: BuildCommitCommand

 private string[] BuildCommitCommand(LogEntry logEntry)
 {
     var tree = logEntry.Tree ?? GetTemporaryIndexTreeSha();
     tree.AssertValidSha();
     var commitCommand = new List<string> { "commit-tree", tree };
     foreach (var parent in logEntry.CommitParents)
     {
         commitCommand.Add("-p");
         commitCommand.Add(parent);
     }
     return commitCommand.ToArray();
 }
开发者ID:roend83,项目名称:git-tfs,代码行数:12,代码来源:GitTfsRemote.cs

示例4: Commit

 private string Commit(LogEntry logEntry)
 {
     string commitHash = null;
     WithCommitHeaderEnv(logEntry, () => commitHash = WriteCommit(logEntry));
     // TODO (maybe): StoreChangesetMetadata(commitInfo);
     return commitHash;
 }
开发者ID:roend83,项目名称:git-tfs,代码行数:7,代码来源:GitTfsRemote.cs

示例5: ProcessChangeset

        private string ProcessChangeset(ITfsChangeset changeset, LogEntry log)
        {
            if (ExportMetadatas)
            {
                if (changeset.Summary.Workitems.Any()) {
                    var workItemIds = TranslateWorkItems(changeset.Summary.Workitems.Select(wi => wi.Id.ToString()));
                    if (workItemIds != null) {
                        log.Log += "\nwork-items: " + string.Join(", ", workItemIds.Select(s => "#" + s));
                    }
                }

                if (!string.IsNullOrWhiteSpace(changeset.Summary.PolicyOverrideComment))
                    log.Log += "\n" + GitTfsConstants.GitTfsPolicyOverrideCommentPrefix + changeset.Summary.PolicyOverrideComment;

                if (!string.IsNullOrWhiteSpace(changeset.Summary.CodeReviewer))
                    log.Log += "\n" + GitTfsConstants.GitTfsCodeReviewerPrefix + changeset.Summary.CodeReviewer;

                if (!string.IsNullOrWhiteSpace(changeset.Summary.SecurityReviewer))
                    log.Log += "\n" + GitTfsConstants.GitTfsSecurityReviewerPrefix + changeset.Summary.SecurityReviewer;

                if (!string.IsNullOrWhiteSpace(changeset.Summary.PerformanceReviewer))
                    log.Log += "\n" + GitTfsConstants.GitTfsPerformanceReviewerPrefix + changeset.Summary.PerformanceReviewer;
            }

            var commitSha = Commit(log);
            UpdateTfsHead(commitSha, changeset.Summary.ChangesetId);
            StringBuilder metadatas = new StringBuilder();
            if (changeset.Summary.Workitems.Any())
            {
                string workitemNote = "Workitems:\n";
                foreach (var workitem in changeset.Summary.Workitems)
                {
                    var workitemId = workitem.Id.ToString();
                    var workitemUrl = workitem.Url;
                    if (ExportMetadatas && ExportWorkitemsMapping.Count != 0)
                    {
                        if (ExportWorkitemsMapping.ContainsKey(workitemId))
                        {
                            var oldWorkitemId = workitemId;
                            workitemId = ExportWorkitemsMapping[workitemId];
                            workitemUrl = workitemUrl.Replace(oldWorkitemId, workitemId);
                        }
                    }
                    workitemNote += String.Format("[{0}] {1}\n    {2}\n", workitemId, workitem.Title, workitemUrl);
                }
                metadatas.Append(workitemNote);
            }

            if (!string.IsNullOrWhiteSpace(changeset.Summary.PolicyOverrideComment))
                metadatas.Append("\nPolicy Override Comment:" + changeset.Summary.PolicyOverrideComment);

            if (!string.IsNullOrWhiteSpace(changeset.Summary.CodeReviewer))
                metadatas.Append("\nCode Reviewer:" + changeset.Summary.CodeReviewer);

            if (!string.IsNullOrWhiteSpace(changeset.Summary.SecurityReviewer))
                metadatas.Append("\nSecurity Reviewer:" + changeset.Summary.SecurityReviewer);

            if (!string.IsNullOrWhiteSpace(changeset.Summary.PerformanceReviewer))
                metadatas.Append("\nPerformance Reviewer:" + changeset.Summary.PerformanceReviewer);

            if (!string.IsNullOrWhiteSpace(changeset.OmittedParentBranch))
                metadatas.Append("\nOmitted parent branch: " + changeset.OmittedParentBranch);

            if (metadatas.Length != 0)
                Repository.CreateNote(commitSha, metadatas.ToString(), log.AuthorName, log.AuthorEmail, log.Date);
            return commitSha;
        }
开发者ID:huylu,项目名称:git-tfs,代码行数:67,代码来源:GitTfsRemote.cs

示例6: Commit

 private string Commit(LogEntry logEntry)
 {
     logEntry.Log = BuildCommitMessage(logEntry.Log, logEntry.ChangesetId);
     return Repository.Commit(logEntry).Sha;
 }
开发者ID:huylu,项目名称:git-tfs,代码行数:5,代码来源:GitTfsRemote.cs

示例7: WriteCommit

        private string WriteCommit(LogEntry logEntry)
        {
            // TODO (maybe): encode logEntry.Log according to 'git config --get i18n.commitencoding', if specified
            //var commitEncoding = Repository.CommandOneline("config", "i18n.commitencoding");
            //var encoding = LookupEncoding(commitEncoding) ?? Encoding.UTF8;
            string commitHash = null;

            //the remote to be associated with the commit might be a subtree, if it's null then it's not from a subtree.
            var remote = logEntry.Remote ?? this;
            Repository.CommandInputOutputPipe((procIn, procOut) =>
                                                  {
                                                      procIn.WriteLine(logEntry.Log);
                                                      procIn.WriteLine(GitTfsConstants.TfsCommitInfoFormat, remote.TfsUrl,
                                                                       remote.TfsRepositoryPath, logEntry.ChangesetId);
                                                      procIn.Close();
                                                      commitHash = ParseCommitInfo(procOut.ReadToEnd());
                                                  }, BuildCommitCommand(logEntry));
            return commitHash;
        }
开发者ID:zidad,项目名称:git-tfs,代码行数:19,代码来源:GitTfsRemote.cs

示例8: MakeNewLogEntry

 private LogEntry MakeNewLogEntry(IChangeset changesetToLog)
 {
     var log = new LogEntry();
     var identity = tfs.GetIdentity(changesetToLog.Committer);
     log.CommitterName = log.AuthorName = null != identity ? identity.DisplayName ?? "Unknown TFS user" : changesetToLog.Committer ?? "Unknown TFS user";
     log.CommitterEmail = log.AuthorEmail = null != identity ? identity.MailAddress ?? changesetToLog.Committer : changesetToLog.Committer;
     log.Date = changesetToLog.CreationDate;
     log.Log = changesetToLog.Comment + Environment.NewLine;
     log.ChangesetId = changesetToLog.ChangesetId;
     return log;
 }
开发者ID:Iristyle,项目名称:git-tfs,代码行数:11,代码来源:TfsChangeset.cs

示例9: BuildCommitCommand

 private string[] BuildCommitCommand(LogEntry logEntry)
 {
     var commitCommand = new List<string> { "commit-tree", logEntry.Tree };
     foreach (var parent in logEntry.CommitParents)
     {
         commitCommand.Add("-p");
         commitCommand.Add(parent);
     }
     return commitCommand.ToArray();
 }
开发者ID:KindDragon,项目名称:git-tfs,代码行数:10,代码来源:GitTfsRemote.cs


注:本文中的Sep.Git.Tfs.Core.LogEntry类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。