Skip to content

Commit

Permalink
Merge pull request #4210 from gerhardol/feature/n4204-bitbucket-rename
Browse files Browse the repository at this point in the history
Rename "Atlassian Stash" to Bitbucket
  • Loading branch information
RussKie committed Dec 13, 2017
2 parents 60f2c5c + d136a37 commit afb9e22
Show file tree
Hide file tree
Showing 26 changed files with 131 additions and 129 deletions.
5 changes: 4 additions & 1 deletion GitExtensions.VS2015.sln
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Git.hub", "Externals\Git.hu
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NBug", "Externals\NBug\NBug\NBug.csproj", "{62CED1D5-F603-40DE-8BF5-3E49D3A392F4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stash", "Plugins\Stash\Stash.csproj", "{50AEAB6C-83C4-45F8-AA01-90E1405C48AF}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bitbucket", "Plugins\Bitbucket\Bitbucket.csproj", "{50AEAB6C-83C4-45F8-AA01-90E1405C48AF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JenkinsIntegration", "Plugins\BuildServerIntegration\JenkinsIntegration\JenkinsIntegration.csproj", "{E6AAC693-815B-4D1A-83D7-F4DE36072793}"
EndProject
Expand Down Expand Up @@ -705,4 +705,7 @@ Global
{93CE3A27-5A63-4436-8C64-CBCA75322C5B} = {020F800B-9170-4BB3-83C9-FCF83596D83C}
{626CA9EB-DB83-4BEB-87D5-15E3B397EF57} = {3D5CA0E0-EF51-4488-A8B7-86CC330D7AD8}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {ECECB7EA-BCCF-44AD-B63E-C2FA45589FB0}
EndGlobalSection
EndGlobal
4 changes: 2 additions & 2 deletions GitExtensions/GitExtensions.Mono.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,9 @@
<Name>ReleaseNotesGenerator</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\Plugins\Stash\Stash.csproj">
<ProjectReference Include="..\Plugins\Bitbucket\Bitbucket.csproj">
<Project>{50AEAB6C-83C4-45F8-AA01-90E1405C48AF}</Project>
<Name>Stash</Name>
<Name>Bitbucket</Name>
</ProjectReference>
<ProjectReference Include="..\Plugins\Statistics\GitImpact\GitImpact.csproj">
<Project>{0B131F9D-BB10-4C3E-9656-5AB858158DE5}</Project>
Expand Down
7 changes: 2 additions & 5 deletions GitExtensions/GitExtensions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,9 @@
<Name>ReleaseNotesGenerator</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\Plugins\Stash\Stash.csproj">
<ProjectReference Include="..\Plugins\Bitbucket\Bitbucket.csproj">
<Project>{50AEAB6C-83C4-45F8-AA01-90E1405C48AF}</Project>
<Name>Stash</Name>
<Name>Bitbucket</Name>
</ProjectReference>
<ProjectReference Include="..\Plugins\Statistics\GitImpact\GitImpact.csproj">
<Project>{0B131F9D-BB10-4C3E-9656-5AB858158DE5}</Project>
Expand Down Expand Up @@ -232,18 +232,15 @@
<PluginBinary Include="..\Plugins\*\bin\$(Configuration)\*.dll" />
<PluginBinary Include="..\Plugins\Statistics\*\bin\$(Configuration)\*.dll" />
<PluginBinary Include="..\Plugins\BuildServerIntegration\*\bin\$(Configuration)\*.dll" />

<!-- Plugin symbols-->
<PluginBinary Include="..\Plugins\*\bin\$(Configuration)\*.pdb" />
<PluginBinary Include="..\Plugins\Statistics\*\bin\$(Configuration)\*.pdb" />
<PluginBinary Include="..\Plugins\BuildServerIntegration\*\bin\$(Configuration)\*.pdb" />

<!-- Plugin satellite assemblies -->
<PluginSatelliteBinary Include="..\Plugins\*\bin\$(Configuration)\*\*.dll" />
<PluginSatelliteBinary Include="..\Plugins\Statistics\*\bin\$(Configuration)\*\*.dll" />
<PluginSatelliteBinary Include="..\Plugins\BuildServerIntegration\*\bin\$(Configuration)\*\*.dll" />
</ItemGroup>

<ItemGroup>
<None Include="@(PluginBinary)" Exclude="..\Plugins\**\Microsoft.TeamFoundation.WorkItemTracking.Client.DataStoreLoader.dll;..\Plugins\**\Microsoft.WITDataStore.dll">
<Link>Plugins\%(Filename)%(Extension)</Link>
Expand Down
2 changes: 1 addition & 1 deletion GitExtensionsMono.sln
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BuildServerIntegration", "B
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TeamCityIntegration", "Plugins\BuildServerIntegration\TeamCityIntegration\TeamCityIntegration.csproj", "{121965D1-4399-4538-B8BF-403EB5B847C3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stash", "Plugins\Stash\Stash.csproj", "{50AEAB6C-83C4-45F8-AA01-90E1405C48AF}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bitbucket", "Plugins\Bitbucket\Bitbucket.csproj", "{50AEAB6C-83C4-45F8-AA01-90E1405C48AF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitUI", "GitUI\GitUI.csproj", "{CF5B22E7-230F-4E50-BE88-C4F7023CED2C}"
EndProject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
using Newtonsoft.Json.Linq;
using RestSharp;

namespace Stash
namespace Bitbucket
{
class ApprovePullRequest : StashRequestBase<JObject>
class ApprovePullRequest : BitbucketRequestBase<JObject>
{
private readonly MergeRequestInfo _info;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<ProjectGuid>{50AEAB6C-83C4-45F8-AA01-90E1405C48AF}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Stash</RootNamespace>
<AssemblyName>Stash</AssemblyName>
<RootNamespace>Bitbucket</RootNamespace>
<AssemblyName>Bitbucket</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile>
Expand Down Expand Up @@ -64,16 +64,16 @@
<Compile Include="GetRelatedRepoRequest.cs" />
<Compile Include="GetRepoRequest.cs" />
<Compile Include="GetUserRequest.cs" />
<Compile Include="StashPlugin.cs" />
<Compile Include="BitbucketPlugin.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Settings.cs" />
<Compile Include="StashPullRequestForm.cs">
<Compile Include="BitbucketPullRequestForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="StashPullRequestForm.Designer.cs">
<DependentUpon>StashPullRequestForm.cs</DependentUpon>
<Compile Include="BitbucketPullRequestForm.Designer.cs">
<DependentUpon>BitbucketPullRequestForm.cs</DependentUpon>
</Compile>
<Compile Include="StashRequestBase.cs" />
<Compile Include="BitbucketRequestBase.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\GitCommands\GitCommands.csproj">
Expand All @@ -98,8 +98,8 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="StashPullRequestForm.resx">
<DependentUpon>StashPullRequestForm.cs</DependentUpon>
<EmbeddedResource Include="BitbucketPullRequestForm.resx">
<DependentUpon>BitbucketPullRequestForm.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
Expand Down
35 changes: 35 additions & 0 deletions Plugins/Bitbucket/BitbucketPlugin.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System.Windows.Forms;
using GitUIPluginInterfaces;
using ResourceManager;

namespace Bitbucket
{
public class BitbucketPlugin : GitPluginBase
{
public readonly StringSetting BitbucketUsername = new StringSetting("Bitbucket Username", string.Empty);
public readonly PasswordSetting BitbucketPassword = new PasswordSetting("Bitbucket Password", string.Empty);
public readonly StringSetting BitbucketBaseUrl = new StringSetting("Specify the base URL to Bitbucket", "https://example.bitbucket.com");
public readonly BoolSetting BitbucketDisableSsl = new BoolSetting("Disable SSL verification", false);

public BitbucketPlugin()
{
SetNameAndDescription("Create Bitbucket Pull Request");
Translate();
}

public override bool Execute(GitUIBaseEventArgs gitUiCommands)
{
using (var frm = new BitbucketPullRequestForm(this, base.Settings, gitUiCommands))
frm.ShowDialog(gitUiCommands.OwnerForm);
return true;
}

public override System.Collections.Generic.IEnumerable<ISetting> GetSettings()
{
yield return BitbucketUsername;
yield return BitbucketPassword;
yield return BitbucketBaseUrl;
yield return BitbucketDisableSsl;
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,24 @@
using System.Threading;
using ResourceManager;

namespace Stash
namespace Bitbucket
{
public partial class StashPullRequestForm : GitExtensionsFormBase
public partial class BitbucketPullRequestForm : GitExtensionsFormBase
{
private readonly TranslationString _yourRepositoryIsNotInStash = new TranslationString("Your repository is not hosted in Bitbucket.");
private readonly TranslationString _yourRepositoryIsNotInBitbucket = new TranslationString("Your repository is not hosted in Bitbucket.");
private readonly TranslationString _commited = new TranslationString("{0} committed\n{1}");
private readonly TranslationString _success = new TranslationString("Success");
private readonly TranslationString _error = new TranslationString("Error");

private Settings _settings;
private readonly StashPlugin _plugin;
private readonly BitbucketPlugin _plugin;
private readonly GitUIBaseEventArgs _gitUiCommands;
private readonly ISettingsSource _settingsContainer;
private readonly BindingList<StashUser> _reviewers = new BindingList<StashUser>();
private readonly List<string> _stashUsers = new List<string>();
private readonly BindingList<BitbucketUser> _reviewers = new BindingList<BitbucketUser>();
private readonly List<string> _bitbucketUsers = new List<string>();


public StashPullRequestForm(StashPlugin plugin, ISettingsSource settings, GitUIBaseEventArgs gitUiCommands)
public BitbucketPullRequestForm(BitbucketPlugin plugin, ISettingsSource settings, GitUIBaseEventArgs gitUiCommands)
{
InitializeComponent();
Translate();
Expand All @@ -35,16 +35,16 @@ public StashPullRequestForm(StashPlugin plugin, ISettingsSource settings, GitUIB
_gitUiCommands = gitUiCommands;
}

private void StashPullRequestFormLoad(object sender, EventArgs e)
private void BitbucketPullRequestFormLoad(object sender, EventArgs e)
{
_settings = Settings.Parse(_gitUiCommands.GitModule, _settingsContainer, _plugin);
if (_settings == null)
{
MessageBox.Show(_yourRepositoryIsNotInStash.Text);
MessageBox.Show(_yourRepositoryIsNotInBitbucket.Text);
Close();
return;
}
//_stashUsers.AddRange(GetStashUsers().Select(a => a.Slug));
//_bitbucketUsers.AddRange(GetBitbucketUsers().Select(a => a.Slug));
ThreadPool.QueueUserWorkItem(state =>
{
var repositories = GetRepositories();
Expand All @@ -64,7 +64,7 @@ private void StashPullRequestFormLoad(object sender, EventArgs e)
});
}

private void StashViewPullRequestFormLoad(object sender, EventArgs e)
private void BitbucketViewPullRequestFormLoad(object sender, EventArgs e)
{
if (_settings == null)
return;
Expand Down Expand Up @@ -139,29 +139,29 @@ private void BtnCreateClick(object sender, EventArgs e)
if (response.Success)
{
MessageBox.Show(_success.Text);
StashViewPullRequestFormLoad(null, null);
BitbucketViewPullRequestFormLoad(null, null);
}
else
MessageBox.Show(string.Join(Environment.NewLine, response.Messages),
_error.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
}

private IEnumerable<StashUser> GetStashUsers()
private IEnumerable<BitbucketUser> GetBitbucketUsers()
{
var list = new List<StashUser>();
var list = new List<BitbucketUser>();
var getUser = new GetUserRequest(_settings);
var result = getUser.Send();
if (result.Success)
{
foreach (var value in result.Result["values"])
{
list.Add(new StashUser { Slug = value["slug"].ToString() });
list.Add(new BitbucketUser { Slug = value["slug"].ToString() });
}
}
return list;
}
Dictionary<Repository, IEnumerable<string>> Branches = new Dictionary<Repository,IEnumerable<string>>();
private IEnumerable<string> GetStashBranches(Repository selectedRepo)
private IEnumerable<string> GetBitbucketBranches(Repository selectedRepo)
{
if (Branches.ContainsKey(selectedRepo))
{
Expand Down Expand Up @@ -189,7 +189,7 @@ private void ReviewersDataGridEditingControlShowing(object sender, DataGridViewE
cellEdit.AutoCompleteCustomSource = new AutoCompleteStringCollection();
cellEdit.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
cellEdit.AutoCompleteSource = AutoCompleteSource.CustomSource;
cellEdit.AutoCompleteCustomSource.AddRange(_stashUsers.ToArray());
cellEdit.AutoCompleteCustomSource.AddRange(_bitbucketUsers.ToArray());
}
}

Expand All @@ -205,7 +205,7 @@ private void DdlRepositoryTargetSelectedValueChanged(object sender, EventArgs e)

private void RefreshDDLBranch(ComboBox comboBox, object selectedValue)
{
List<string> lsNames = (GetStashBranches((Repository)selectedValue)).ToList();
List<string> lsNames = (GetBitbucketBranches((Repository)selectedValue)).ToList();
lsNames.Sort();
lsNames.Insert(0, "");
comboBox.DataSource = lsNames;
Expand Down Expand Up @@ -314,7 +314,7 @@ private void BtnMergeClick(object sender, EventArgs e)
if (response.Success)
{
MessageBox.Show(_success.Text);
StashViewPullRequestFormLoad(null, null);
BitbucketViewPullRequestFormLoad(null, null);
}
else
MessageBox.Show(string.Join(Environment.NewLine, response.Messages),
Expand All @@ -339,7 +339,7 @@ private void BtnApproveClick(object sender, EventArgs e)
if (response.Success)
{
MessageBox.Show(_success.Text);
StashViewPullRequestFormLoad(null, null);
BitbucketViewPullRequestFormLoad(null, null);
}
else
MessageBox.Show(string.Join(Environment.NewLine, response.Messages),
Expand Down
File renamed without changes.
Loading

0 comments on commit afb9e22

Please sign in to comment.