aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.Common
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2020-11-25 01:21:31 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2020-11-25 01:21:31 +0200
commitab09d7fbef132e95c2182f4c9abece25329d35df (patch)
treeb9cd9ddc4fecc6fc55a7d19bcc426c6f97024b43 /Software/Visual_Studio/PPC/Tango.PPC.Common
parentc2e6c0cf0bff210e13c95beeecc8c732e4436745 (diff)
downloadTango-ab09d7fbef132e95c2182f4c9abece25329d35df.tar.gz
Tango-ab09d7fbef132e95c2182f4c9abece25329d35df.zip
Pre Tag 'PPC_v1.2.5' commit.
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Common')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PPCPublisher.cs28
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PublishOptions.cs8
2 files changed, 30 insertions, 6 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PPCPublisher.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PPCPublisher.cs
index c77fb32f0..62c4420d9 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PPCPublisher.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PPCPublisher.cs
@@ -183,6 +183,10 @@ namespace Tango.PPC.Common.Publish
if (Options.CreateTag)
{
+ String tagVersion = System.Version.Parse(GetLocalVersion()).ToString(3);
+ String tagName = $"PPC_v{tagVersion}";
+ String tagDescription = $"Snapshot of PPC v{tagVersion}";
+
String repoPath = Path.GetFullPath("../../../../../");
using (GitRepositoryManager git = new GitRepositoryManager(repoPath, Options.Email, Options.PersonalAccessToken))
{
@@ -190,20 +194,32 @@ namespace Tango.PPC.Common.Publish
int changes = git.GetChanges().Count;
if (changes > 0)
{
- throw new InvalidOperationException($"There are {changes} uncommitted changes on the repository. Please commit and push all changes before creating the Tag");
+ if (Options.AutoCommitAndPush)
+ {
+ OnPublishProgress(0, 100, "Committing repository changes...");
+ git.Commit($"Pre Tag '{tagName}' commit.");
+ }
+ else
+ {
+ throw new InvalidOperationException($"There are {changes} uncommitted changes on the repository. Please commit and push all changes before creating the Tag");
+ }
}
OnPublishProgress(0, 100, "Checking outgoing commits...");
int commits = git.GetOutgoingCommits().Count;
if (commits > 0)
{
- throw new InvalidOperationException($"There are {commits} outgoing commits on the repository. Please push all commits before creating the Tag");
+ if (Options.AutoCommitAndPush)
+ {
+ OnPublishProgress(0, 100, "Pushing repository changes...");
+ git.Push();
+ }
+ else
+ {
+ throw new InvalidOperationException($"There are {commits} outgoing commits on the repository. Please push all commits before creating the Tag");
+ }
}
- String tagVersion = System.Version.Parse(GetLocalVersion()).ToString(3);
- String tagName = $"PPC_v{tagVersion}";
- String tagDescription = $"Snapshot of PPC v{tagVersion}";
-
git.Progress += (x, e) =>
{
OnPublishProgress(e.Progress.Value, e.Progress.Maximum, $"Pushing Tag '{tagName}'...");
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PublishOptions.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PublishOptions.cs
index 8279aef46..399a19f0d 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PublishOptions.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PublishOptions.cs
@@ -120,6 +120,14 @@ namespace Tango.PPC.Common.Publish
set { _createTag = value; RaisePropertyChangedAuto(); }
}
+ private bool _autoCommitAndSync;
+ public bool AutoCommitAndPush
+ {
+ get { return _autoCommitAndSync; }
+ set { _autoCommitAndSync = value; RaisePropertyChangedAuto(); }
+ }
+
+
public PublishOptions()
{
BasePath = AppDomain.CurrentDomain.BaseDirectory + "..\\";