Не учитываем закрытые ветки
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
namespace JiraTimeBotForm
|
namespace JiraTimeBotForm
|
||||||
@@ -11,9 +12,33 @@ namespace JiraTimeBotForm
|
|||||||
[STAThread]
|
[STAThread]
|
||||||
static void Main()
|
static void Main()
|
||||||
{
|
{
|
||||||
|
if (PriorProcess() != null)
|
||||||
|
{
|
||||||
|
|
||||||
|
MessageBox.Show("Another instance of the app is already running.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Application.EnableVisualStyles();
|
Application.EnableVisualStyles();
|
||||||
Application.SetCompatibleTextRenderingDefault(false);
|
Application.SetCompatibleTextRenderingDefault(false);
|
||||||
Application.Run(new frmMain());
|
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;
|
continue;
|
||||||
}
|
}
|
||||||
|
//Пропускаем Close коммиты
|
||||||
|
if (changeset.CommitMessage.StartsWith($"Close {changeset.Branch} branch"))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
workTasks.Add(changeset.Branch);
|
workTasks.Add(changeset.Branch);
|
||||||
_log.Trace($" - Найден changeset: {changeset.Timestamp} - {changeset.Branch} - {changeset.AuthorEmailAddress}");
|
_log.Trace($" - Найден changeset: {changeset.Timestamp} - {changeset.Branch} - {changeset.AuthorEmailAddress}");
|
||||||
|
|||||||
Generated
+1
@@ -145,6 +145,7 @@ namespace JiraTimeBotForm
|
|||||||
this.txtLog.Location = new System.Drawing.Point(218, 16);
|
this.txtLog.Location = new System.Drawing.Point(218, 16);
|
||||||
this.txtLog.Multiline = true;
|
this.txtLog.Multiline = true;
|
||||||
this.txtLog.Name = "txtLog";
|
this.txtLog.Name = "txtLog";
|
||||||
|
this.txtLog.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
|
||||||
this.txtLog.Size = new System.Drawing.Size(510, 264);
|
this.txtLog.Size = new System.Drawing.Size(510, 264);
|
||||||
this.txtLog.TabIndex = 11;
|
this.txtLog.TabIndex = 11;
|
||||||
//
|
//
|
||||||
|
|||||||
Reference in New Issue
Block a user