Не учитываем закрытые ветки
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,13 +34,18 @@ namespace JiraTimeBotForm.TaskTime
|
||||
}
|
||||
|
||||
var repo = new Repository(repoDirectory);
|
||||
var log = repo.Log(new LogCommand {Date = date, Users = { settings.MercurialAuthorEmail }});
|
||||
var log = repo.Log(new LogCommand {Date = date, Users = { settings.MercurialAuthorEmail } });
|
||||
foreach (var changeset in log)
|
||||
{
|
||||
if (!changeset.Branch.Contains("-"))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
//Пропускаем Close коммиты
|
||||
if (changeset.CommitMessage.StartsWith($"Close {changeset.Branch} branch"))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
workTasks.Add(changeset.Branch);
|
||||
_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.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;
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user