Не учитываем закрытые ветки

This commit is contained in:
Danil Kislov
2019-03-05 16:26:59 +03:00
parent f27997b86b
commit 83340c3ef5
3 changed files with 32 additions and 1 deletions
+25
View File
@@ -1,4 +1,5 @@
using System;
using System.Diagnostics;
using System.Windows.Forms;
namespace JiraTimeBotForm
@@ -11,9 +12,33 @@ namespace JiraTimeBotForm
[STAThread]
static void Main()
{
if (PriorProcess() != null)
{
MessageBox.Show("Another instance of the app is already running.");
return;
}
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new frmMain());
}
public static Process PriorProcess()
// Returns a System.Diagnostics.Process pointing to
// a pre-existing process with the same name as the
// current one, if any; or null if the current process
// is unique.
{
Process curr = Process.GetCurrentProcess();
Process[] procs = Process.GetProcessesByName(curr.ProcessName);
foreach (Process p in procs)
{
if ((p.Id != curr.Id) &&
(p.MainModule.FileName == curr.MainModule.FileName))
return p;
}
return null;
}
}
}
@@ -41,6 +41,11 @@ namespace JiraTimeBotForm.TaskTime
{
continue;
}
//Пропускаем Close коммиты
if (changeset.CommitMessage.StartsWith($"Close {changeset.Branch} branch"))
{
continue;
}
workTasks.Add(changeset.Branch);
_log.Trace($" - Найден changeset: {changeset.Timestamp} - {changeset.Branch} - {changeset.AuthorEmailAddress}");
+1
View File
@@ -145,6 +145,7 @@ namespace JiraTimeBotForm
this.txtLog.Location = new System.Drawing.Point(218, 16);
this.txtLog.Multiline = true;
this.txtLog.Name = "txtLog";
this.txtLog.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.txtLog.Size = new System.Drawing.Size(510, 264);
this.txtLog.TabIndex = 11;
//