Comparing changes
Open a pull request
- 12 commits
- 10 files changed
- 0 comments
- 3 contributors
Don't sign VSIX on Azure Pipelines PR builds
…e IGitActionsExt2.InitializeOrPushRepositoryToGitService()
…ionsExt2 under 16.0
Change GitHub.TeamFoundation.16 version of TeamExplorerServices
Prevent error when filenames have braces in them
Update Octokit.GraphQL schema
- +2 −0 azure-pipelines.yml
- BIN lib/16.0/Microsoft.TeamFoundation.Client.dll
- BIN lib/16.0/Microsoft.TeamFoundation.Common.dll
- BIN lib/16.0/Microsoft.TeamFoundation.Controls.dll
- BIN lib/16.0/Microsoft.TeamFoundation.Git.Client.dll
- BIN lib/16.0/Microsoft.TeamFoundation.Git.Controls.dll
- BIN lib/16.0/Microsoft.TeamFoundation.Git.Provider.dll
- +11 −4 src/GitHub.App/Services/PullRequestEditorService.cs
- +25 −0 src/GitHub.TeamFoundation.14/Services/TeamExplorerServices.cs
- +1 −1 submodules/octokit.graphql.net
| @@ -101,9 +101,11 @@ jobs: | ||
| secureFile: certificate.pfx | ||
|
|
||
| - script: $(vsixsigntool_exe.secureFilePath) sign /f $(certificate_pfx.secureFilePath) /p "$(certificate_password)" /sha1 9c5a6d389e1454f2ed9ee9419cdf743689709f9c /fd sha256 /tr http://timestamp.digicert.com /td sha256 $(ArtifactDirectory)\GitHub.VisualStudio.vsix | ||
| condition: not(eq(variables['Build.Reason'], 'PullRequest')) | ||
| displayName: Sign the GitHub for Visual Studio VSIX | ||
|
|
||
| - script: $(vsixsigntool_exe.secureFilePath) sign /f $(certificate_pfx.secureFilePath) /p "$(certificate_password)" /sha1 9c5a6d389e1454f2ed9ee9419cdf743689709f9c /fd sha256 /tr http://timestamp.digicert.com /td sha256 $(ArtifactDirectory)\GitHub.VisualStudio.16.vsix | ||
| condition: not(eq(variables['Build.Reason'], 'PullRequest')) | ||
| displayName: Sign the GitHub Essentials VSIX | ||
|
|
||
| - task: PublishBuildArtifacts@1 | ||
| @@ -219,10 +219,10 @@ public async Task<IDifferenceViewer> OpenDiff(IPullRequestSession session, strin | ||
| frame = VisualStudio.Services.DifferenceService.OpenComparisonWindow2( | ||
| leftFile, | ||
| rightFile, | ||
| caption, | ||
| tooltip, | ||
| leftLabel, | ||
| rightLabel, | ||
| SanitizeForDisplay(caption), | ||
| SanitizeForDisplay(tooltip), | ||
| SanitizeForDisplay(leftLabel), | ||
| SanitizeForDisplay(rightLabel), | ||
| string.Empty, | ||
| string.Empty, | ||
| (uint)options); | ||
| @@ -284,6 +284,13 @@ public async Task<IDifferenceViewer> OpenDiff(IPullRequestSession session, strin | ||
| } | ||
| } | ||
|
|
||
| private static string SanitizeForDisplay(string caption) | ||
| { | ||
| // The diff window passes captions and tooltips through string.Format, with {0} and {1} being the left and right file respectively, but we already | ||
| // nicely format the file names with extra info we know, so we have to escape braces to prevent unwanted formatting, or invalid format errors. | ||
| return caption.Replace("{", "{{").Replace("}", "}}"); | ||
| } | ||
|
|
||
| /// <inheritdoc/> | ||
| public Task<IDifferenceViewer> OpenDiff( | ||
| IPullRequestSession session, | ||
| @@ -9,6 +9,7 @@ | ||
| using EnvDTE; | ||
| using GitHub.VisualStudio.TeamExplorer.Sync; | ||
| using Microsoft.TeamFoundation.Controls; | ||
| using Microsoft.VisualStudio.TeamFoundation.Git.Extensibility; | ||
| using ReactiveUI; | ||
|
|
||
| namespace GitHub.Services | ||
| @@ -66,12 +67,36 @@ public void ShowHomePage() | ||
|
|
||
| public void ShowPublishSection() | ||
| { | ||
| #if TEAMEXPLORER16 | ||
| // Only call InitializeOrPushRepositoryToGitService when IGitActionsExt2 exists | ||
| if (FindIGitActionsExt2() is object) | ||
| { | ||
| InitializeOrPushRepositoryToGitService(); | ||
| return; | ||
| } | ||
| #endif | ||
|
|
||
| var te = serviceProvider.TryGetService<ITeamExplorer>(); | ||
| var page = te.NavigateToPage(new Guid(TeamExplorerPageIds.GitCommits), null); | ||
| var publish = page?.GetSection(new Guid(GitHubPublishSection.GitHubPublishSectionId)) as GitHubPublishSection; | ||
| publish?.Connect(); | ||
| } | ||
|
|
||
| #if TEAMEXPLORER16 | ||
| private static Type FindIGitActionsExt2() | ||
| { | ||
| Type type = typeof(IGitActionsExt); | ||
| string name = $"{type.FullName}2"; | ||
| return type.Assembly.GetType(name, false); | ||
| } | ||
|
|
||
| private void InitializeOrPushRepositoryToGitService() | ||
| { | ||
| IGitActionsExt2 gitActionsExt = serviceProvider.TryGetService<IGitActionsExt2>(); | ||
| gitActionsExt?.InitializeOrPushRepositoryToGitService(); | ||
| } | ||
| #endif | ||
|
|
||
| public async Task ShowRepositorySettingsRemotesAsync() | ||
| { | ||
| var te = serviceProvider.TryGetService<ITeamExplorer>(); | ||

