From c95f228ef07ad08ffd4f110b02c588157b9bf11c Mon Sep 17 00:00:00 2001 From: Danil Kislov Date: Tue, 2 Jul 2019 18:09:22 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D0=B8?= =?UTF-8?q?=20=D0=BA=D0=BE=D0=B3=D0=B4=D0=B0=20=D1=80=D0=B5=D0=BB=D0=B8?= =?UTF-8?q?=D0=B7+=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=20=D0=BD=D0=B0?= =?UTF-8?q?=D0=B4=20=D0=B7=D0=B0=D0=B4=D0=B0=D1=87=D0=B5=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .semver.txt | 2 +- src/JiraTimeBot/Properties/AssemblyInfo.cs | 62 +++++++++---------- .../TaskTime/TaskTimeByCommitsCalculator.cs | 13 +++- 3 files changed, 44 insertions(+), 33 deletions(-) diff --git a/.semver.txt b/.semver.txt index 3a90b24..c3ccccf 100644 --- a/.semver.txt +++ b/.semver.txt @@ -1 +1 @@ -1.0.58 +1.0.59 diff --git a/src/JiraTimeBot/Properties/AssemblyInfo.cs b/src/JiraTimeBot/Properties/AssemblyInfo.cs index 8d9130f..ba22032 100644 --- a/src/JiraTimeBot/Properties/AssemblyInfo.cs +++ b/src/JiraTimeBot/Properties/AssemblyInfo.cs @@ -1,31 +1,31 @@ -using System.Reflection; -using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("JiraTimeBot")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("JiraTimeBot")] -[assembly: AssemblyCopyright("Copyright © 2019")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("f3b89316-c38c-4ce6-9d88-0b1373cfba1a")] -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.58")] -[assembly: AssemblyFileVersion("1.0.58")] -[assembly: AssemblyInformationalVersion("1.0.58")] +using System.Reflection; +using System.Runtime.InteropServices; +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("JiraTimeBot")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("JiraTimeBot")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("f3b89316-c38c-4ce6-9d88-0b1373cfba1a")] +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("1.0.59")] +[assembly: AssemblyFileVersion("1.0.59")] +[assembly: AssemblyInformationalVersion("1.0.59")] diff --git a/src/JiraTimeBot/TaskTime/TaskTimeByCommitsCalculator.cs b/src/JiraTimeBot/TaskTime/TaskTimeByCommitsCalculator.cs index cbd9530..ec25853 100644 --- a/src/JiraTimeBot/TaskTime/TaskTimeByCommitsCalculator.cs +++ b/src/JiraTimeBot/TaskTime/TaskTimeByCommitsCalculator.cs @@ -57,7 +57,18 @@ namespace JiraTimeBot.TaskTime } var workTasks = _spreadHelper.SpreadTime(taskCommits, remainMinutes, settings.RoundToMinutes); - workTimeItems.AddRange(workTasks); + foreach (var workTask in workTasks) + { + var existingItem = workTimeItems.FirstOrDefault(f => f.Branch == workTask.Branch); + if (existingItem != null) + { + existingItem.TimeSpent += workTask.TimeSpent; + existingItem.Description += "\r\n" + workTask.Description; + continue; + } + + workTimeItems.Add(workTask); + } workTimeItems = workTimeItems.OrderByDescending(f => f.TimeSpent).ToList(); remainMinutes = minutesPerWorkDay - (int) workTimeItems.Sum(f => f.TimeSpent.TotalMinutes);