From 087c4f19092d73385d565cfd9fad945ff68a6d88 Mon Sep 17 00:00:00 2001 From: Danil Kislov Date: Thu, 27 Jun 2019 22:00:19 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=B1=D1=80=D0=B0=D0=BD=D1=8B=20=D1=81?= =?UTF-8?q?=D1=82=D0=B0=D1=82=D0=B8=D1=87=D0=BD=D1=8B=D0=B5=20=D0=BA=D0=BE?= =?UTF-8?q?=D0=BC=D0=BC=D0=B5=D0=BD=D1=82=D0=B0=D1=80=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Comments/JiraDescriptionSource.cs | 21 +------------------ src/JiraTimeBot/Mercurial/MercurialLog.cs | 1 + 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/src/JiraTimeBot/JiraIntegration/Comments/JiraDescriptionSource.cs b/src/JiraTimeBot/JiraIntegration/Comments/JiraDescriptionSource.cs index b81df7f..5e772db 100644 --- a/src/JiraTimeBot/JiraIntegration/Comments/JiraDescriptionSource.cs +++ b/src/JiraTimeBot/JiraIntegration/Comments/JiraDescriptionSource.cs @@ -1,32 +1,13 @@ using JiraTimeBot.Configuration; using JiraTimeBot.TaskTime.Objects; -using System; -using System.Collections.Generic; -using System.Linq; namespace JiraTimeBot.JiraIntegration.Comments { public class JiraDescriptionSource : IJiraDescriptionSource { - private readonly List _dummyComments = new List - { - "Написание кода", "написание кода", "программирование", "реализация задачи", "кодинг", "код + тесты", - "кодинг", "написание кода и тестов" - }; - public string GetDescription(TaskTimeItem taskTimeItem, bool addCommentsToWorklog, Settings settings) { - if (addCommentsToWorklog) - { - return taskTimeItem.Description; - } - - if (settings.WorkType == WorkType.Mercurial) - { - return _dummyComments.OrderBy(f => Guid.NewGuid()).FirstOrDefault(); - } - - return ""; + return addCommentsToWorklog ? taskTimeItem.Description : ""; } } } \ No newline at end of file diff --git a/src/JiraTimeBot/Mercurial/MercurialLog.cs b/src/JiraTimeBot/Mercurial/MercurialLog.cs index 5b91236..ecaead3 100644 --- a/src/JiraTimeBot/Mercurial/MercurialLog.cs +++ b/src/JiraTimeBot/Mercurial/MercurialLog.cs @@ -82,6 +82,7 @@ namespace JiraTimeBot.Mercurial TimeSpent = TimeSpan.Zero, Type = GetCommitType(changeset.Branch) }; + if (task.Type == CommitType.Release && task.Description.StartsWith("Merge with", StringComparison.CurrentCultureIgnoreCase)) { var branch = task.Description.Replace("Merge with", "").Replace(" ", "");