private void LogProjectToHtml(StreamWriter writer, SolutionInfo info, string name) { if (info != null && info.SvnLogEntries != null && info.SvnLogEntries.Count > 0) { writer.WriteLine("<h4>{0}</h4>", name); LogItemsToHtml(writer, GetLogMessages(info.SvnLogEntries)); } }
public void GenerateGitHubReleaseLogDescription(StringBuilder sb, SolutionInfo info, string name, string repo) { sb.AppendLine(); sb.AppendLine("##### " + name + " changes"); var dic = new Dictionary<string, List<VersionControlLogEntry>>(); var groups = new List<List<VersionControlLogEntry>>(); foreach (var itm in info.SvnLogEntries) { List<VersionControlLogEntry> childs; if (!dic.TryGetValue(itm.msg.ToLower().Trim(), out childs)) { childs = new List<VersionControlLogEntry>(); dic.Add(itm.msg.ToLower().Trim(), childs); groups.Add(childs); } childs.Add(itm); } foreach (var childs in groups) { var itm = childs[0]; var msg = itm.msg; var reg = new System.Text.RegularExpressions.Regex(@"(\(|\s)(#[0-9]+)(\)\s|.|,)", RegexOptions.RightToLeft); var msgSB = new StringBuilder(msg); foreach (Match m in reg.Matches(msg)) { var hash = m.Groups[2].Value; var issue = "[" + hash + "](../../../../" + Config.GitHubUser + "/" + repo + "/issues/" + hash.Replace("#", "") + ")"; msgSB.Replace(m.Groups[2].Value, issue, m.Groups[2].Index, m.Groups[2].Length); } msg = msgSB.ToString(); //msg = "* " + msg + " ([view](../../commit/" + itm.revision + "))"; msg = "* " + msg + " ("; var revList = new List<string>(); foreach (var child in childs) { revList.Add("[" + child.revision.Substring(0, 7) + "](../../../../" + Config.GitHubUser + "/" + repo + "/commit/" + child.revision + ")"); } msg += string.Join(", ", revList); msg += ")"; sb.AppendLine(msg); } }
SolutionInfo CreateSolutionInfo(string srcDir, SolutionInfo lastSolutionInfo, bool useGit = false) { var si = new SolutionInfo { HeadRevision = GetHeadRevision(srcDir, useGit) }; if (lastSolutionInfo == null || si.HeadRevision == lastSolutionInfo.HeadRevision) si.SvnLogEntries = new List<VersionControlLogEntry>(); else si.SvnLogEntries = GetSvnLog(srcDir, (int.Parse(lastSolutionInfo.HeadRevision) + 1).ToString()); //hack by dan-el return si; }
SolutionInfo CreateSolutionInfo(string srcDir) { var si = new SolutionInfo { HeadRevision = GetHeadRevision(srcDir) }; si.SvnLogEntries = GetGitLog(srcDir, GetLastVersion()); //hack by dan-el return si; }