Skip to content

Commit

Permalink
Merge branch 'release/v1.7.18'
Browse files Browse the repository at this point in the history
  • Loading branch information
Fernando De Mennato committed Jun 6, 2020
2 parents 3b8ae0a + 0c687b5 commit 1a29e56
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 9 deletions.
3 changes: 3 additions & 0 deletions GitFlow.VS.Extension/GitFlow.VS.Extension.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@
<Reference Include="Microsoft.VisualStudio.CoreUtility, Version=16.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.VisualStudio.CoreUtility.16.4.280\lib\net472\Microsoft.VisualStudio.CoreUtility.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualStudio.ExtensionManager, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\VSSDK.ExtensionManager.11.0.0\lib\net45\Microsoft.VisualStudio.ExtensionManager.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualStudio.ImageCatalog, Version=16.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.VisualStudio.ImageCatalog.16.5.29903.111\lib\net45\Microsoft.VisualStudio.ImageCatalog.dll</HintPath>
</Reference>
Expand Down
14 changes: 12 additions & 2 deletions GitFlow.VS.Extension/GitFlowInstallSection.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,29 @@
using System;
using System.ComponentModel.Composition;
using System.Linq;
using GitFlowVS.Extension.UI;
using Microsoft.TeamFoundation.Controls;
using Microsoft.VisualStudio.ExtensionManager;
using Microsoft.VisualStudio.Shell;
using TeamExplorer.Common;

namespace GitFlowVS.Extension
{
[TeamExplorerSection(GuidList.GitFlowInstallSection, GuidList.GitFlowPage, 100)]
public class GitFlowInstallSection : TeamExplorerBaseSection, IGitFlowSection
{
public GitFlowInstallSection()
[ImportingConstructor]
public GitFlowInstallSection([Import(typeof(SVsServiceProvider))] IServiceProvider serviceProvider)
{
try
{
Title = "GitFlow with PR";
SectionContent = new InstallGitFlowUI(this);
IVsExtensionManager manager = serviceProvider.GetService(typeof(SVsExtensionManager)) as IVsExtensionManager;
// get your extension by Product Id
IInstalledExtension myExtension = manager.GetInstalledExtensions().FirstOrDefault();
// get current version
var currentVersion = myExtension.Header.Version;
SectionContent = new InstallGitFlowUI(this, currentVersion);

UpdateVisibleState();

Expand Down
13 changes: 11 additions & 2 deletions GitFlow.VS.Extension/GitFlowPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using GitFlow.VS;
using GitFlowVS.Extension.UI;
using Microsoft.TeamFoundation.Controls;
using Microsoft.VisualStudio.ExtensionManager;
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.Shell.Interop;
using Microsoft.VisualStudio.TeamFoundation.Git.Extensibility;
Expand All @@ -22,6 +23,7 @@ public class GitFlowPage : TeamExplorerBasePage
private static ITeamExplorer teamExplorer;
private static IVsOutputWindowPane outputWindow;
private GitFlowPageUI ui;
private static Version currentVersion;

public static IGitRepositoryInfo ActiveRepo
{
Expand Down Expand Up @@ -61,9 +63,14 @@ public GitFlowPage([Import(typeof(SVsServiceProvider))] IServiceProvider service
gitService = (IGitExt)serviceProvider.GetService(typeof(IGitExt));
teamExplorer = (ITeamExplorer) serviceProvider.GetService(typeof (ITeamExplorer));
gitService.PropertyChanged += OnGitServicePropertyChanged;

// get ExtensionManager
IVsExtensionManager manager = serviceProvider.GetService(typeof(SVsExtensionManager)) as IVsExtensionManager;
// get your extension by Product Id
IInstalledExtension myExtension = manager.GetInstalledExtensions().FirstOrDefault();
// get current version
currentVersion = myExtension.Header.Version;
var outWindow = Package.GetGlobalService(typeof(SVsOutputWindow)) as IVsOutputWindow;
var customGuid = new Guid("2AAAB744-47C6-4208-A26C-35937E69BB50");
var customGuid = new Guid("4BEF3E2A-F42D-4BFB-A99B-7EACAC914C50");
outWindow.CreatePane(ref customGuid, "GitFlow.VS", 1, 1);
outWindow.GetPane(ref customGuid, out outputWindow);

Expand All @@ -85,6 +92,8 @@ public static bool GitFlowIsInstalled
{
get
{
if (!File.Exists(string.Format("GitFlowWithPr.{0}.{1}.{2}", currentVersion.Major, currentVersion.Minor, currentVersion.Revision)))
return false;
//Read PATH to find git installation path
//Check if extension has been configured
string binariesPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Dependencies\\binaries");
Expand Down
5 changes: 4 additions & 1 deletion GitFlow.VS.Extension/GitFlowScriptInstallation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace GitFlowVS.Extension
{
public static class GitFlowScriptInstallation
{
public static int Install()
public static int Install(Version currentVersion)
{
var installationPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
string cmd = Path.Combine(installationPath, "Dependencies\\install.ps1");
Expand All @@ -34,6 +34,9 @@ public static int Install()
proc.Start();
proc.WaitForExit();

if (!File.Exists(string.Format("GitFlowWithPr.{0}.{1}.{2}", currentVersion.Major, currentVersion.Minor, currentVersion.Revision)))
File.Create(string.Format("GitFlowWithPr.{0}.{1}.{2}", currentVersion.Major, currentVersion.Minor, currentVersion.Revision));

return proc.ExitCode;
}

Expand Down
6 changes: 4 additions & 2 deletions GitFlow.VS.Extension/UI/InstallGitFlowUI.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ namespace GitFlowVS.Extension.UI
public partial class InstallGitFlowUI : UserControl
{
private readonly GitFlowInstallSection parent;
private readonly Version currentVersion;

public InstallGitFlowUI(GitFlowInstallSection parent)
public InstallGitFlowUI(GitFlowInstallSection parent, Version currentVersion)
{
Logger.PageView("InstallGitFlow");
this.parent = parent;
this.currentVersion = currentVersion;
InitializeComponent();

if (GitHelper.GetGitInstallationPath() == null)
Expand All @@ -41,7 +43,7 @@ private void Button_Click(object sender, RoutedEventArgs e)
{
Logger.Event("Install");
Error.Visibility = Visibility.Hidden;
var exitCode = GitFlowScriptInstallation.Install();
var exitCode = GitFlowScriptInstallation.Install(this.currentVersion);

if (exitCode != 0)
{
Expand Down
1 change: 1 addition & 0 deletions GitFlow.VS.Extension/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,5 @@
<package id="System.Threading.Tasks.Dataflow" version="4.11.1" targetFramework="net472" />
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net472" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net472" />
<package id="VSSDK.ExtensionManager" version="11.0.0" targetFramework="net48" />
</packages>
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# GitFlow for Visual Studio 2019
# GitFlow with PR for Visual Studio 2019

Forked from https://github.com/jakobehn/GitFlow.VS

Expand All @@ -10,7 +10,7 @@ It exposes the most common GitFlow options when finishing branches, such as opti


### Prerequirements
The extension requires Visual Studio 2019 (it's also available for VS2017 and VS2015). It will install GitFlow and azure-cli for you. Since GitFlow with PR depends on Git for Windows, this must be installed before using the extension
The extension requires Visual Studio 2019. It will install GitFlow and azure-cli for you. Since GitFlow with PR depends on Git for Windows, this must be installed before using the extension


## Screenshots
Expand Down

0 comments on commit 1a29e56

Please sign in to comment.