aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio
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
parentc2e6c0cf0bff210e13c95beeecc8c732e4436745 (diff)
downloadTango-ab09d7fbef132e95c2182f4c9abece25329d35df.tar.gz
Tango-ab09d7fbef132e95c2182f4c9abece25329d35df.zip
Pre Tag 'PPC_v1.2.5' commit.
Diffstat (limited to 'Software/Visual_Studio')
-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
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Publisher.UI/MainWindow.xaml3
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest2
4 files changed, 33 insertions, 8 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 + "..\\";
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Publisher.UI/MainWindow.xaml b/Software/Visual_Studio/PPC/Tango.PPC.Publisher.UI/MainWindow.xaml
index 017c34625..e772a4b87 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Publisher.UI/MainWindow.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Publisher.UI/MainWindow.xaml
@@ -10,7 +10,7 @@
xmlns:web="clr-namespace:Tango.Web;assembly=Tango.Web"
xmlns:local="clr-namespace:Tango.PPC.Publisher.UI"
mc:Ignorable="d"
- Title="Tango PPC Publisher" Height="2000" Width="500" d:DataContext="{d:DesignInstance Type=local:MainWindowVM, IsDesignTimeCreatable=False}">
+ Title="Tango PPC Publisher" Height="1000" Width="500" d:DataContext="{d:DesignInstance Type=local:MainWindowVM, IsDesignTimeCreatable=False}" WindowStartupLocation="CenterScreen">
<Window.Resources>
<converters:EnumToItemsSourceConverter x:Key="EnumToItemsSourceConverter" />
@@ -134,6 +134,7 @@
<StackPanel Margin="0 20 0 0">
<CheckBox x:Name="chkCreateTag" IsChecked="{Binding Options.CreateTag}">Create Tag On Repository</CheckBox>
+ <CheckBox Margin="0 5 0 0" IsChecked="{Binding Options.AutoCommitAndPush}">Auto Commit &amp; Push</CheckBox>
<TextBlock Margin="0 10 0 0">Personal Access Token</TextBlock>
<TextBox IsEnabled="{Binding ElementName=chkCreateTag,Path=IsChecked}" Margin="0 5 0 0" Text="{Binding Options.PersonalAccessToken}"></TextBox>
</StackPanel>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest b/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest
index efc5f8179..d72e75011 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest
@@ -16,7 +16,7 @@
Remove this element if your application requires this virtualization for backwards
compatibility.
-->
- <!--<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />-->
+ <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>