Skip to content

Reintegrate develop fix #596

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 20, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 19 additions & 43 deletions src/GitVersion.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_OBJECT_AND_COLLECTION_INITIALIZER_STYLE/@EntryValue">CHOP_ALWAYS</s:String>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/JavaScriptCodeFormatting/ALIGN_MULTIPLE_DECLARATION/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/JavaScriptCodeFormatting/JavaScriptFormatOther/ALIGN_MULTIPLE_DECLARATION/@EntryValue">True</s:Boolean>
<s:String x:Key="/Default/CodeStyle/CSharpFileLayoutPatterns/Pattern/@EntryValue">&lt;Patterns xmlns="urn:schemas-jetbrains-com:member-reordering-patterns"&gt;&#xD;
<s:String x:Key="/Default/CodeStyle/CSharpFileLayoutPatterns/Pattern/@EntryValue">&lt;?xml version="1.0" encoding="utf-16"?&gt;&#xD;
&lt;Patterns xmlns="urn:schemas-jetbrains-com:member-reordering-patterns"&gt;&#xD;
&lt;TypePattern DisplayName="COM interfaces or structs"&gt;&#xD;
&lt;TypePattern.Match&gt;&#xD;
&lt;Or&gt;&#xD;
Expand All @@ -154,77 +155,67 @@
&lt;HasAttribute Name="System.Runtime.InteropServices.ComImport" /&gt;&#xD;
&lt;/Or&gt;&#xD;
&lt;/And&gt;&#xD;
&lt;HasAttribute Name="System.Runtime.InteropServices.StructLayoutAttribute" /&gt;&#xD;
&lt;Kind Is="Struct" /&gt;&#xD;
&lt;/Or&gt;&#xD;
&lt;/TypePattern.Match&gt;&#xD;
&lt;/TypePattern&gt;&#xD;
&#xD;
&lt;TypePattern DisplayName="NUnit Test Fixtures" RemoveRegions="All"&gt;&#xD;
&lt;TypePattern.Match&gt;&#xD;
&lt;And&gt;&#xD;
&lt;Kind Is="Class" /&gt;&#xD;
&lt;HasAttribute Name="NUnit.Framework.TestFixtureAttribute" Inherited="true" /&gt;&#xD;
&lt;HasAttribute Name="NUnit.Framework.TestCaseFixtureAttribute" Inherited="true" /&gt;&#xD;
&lt;HasAttribute Name="NUnit.Framework.TestFixtureAttribute" Inherited="True" /&gt;&#xD;
&lt;HasAttribute Name="NUnit.Framework.TestCaseFixtureAttribute" Inherited="True" /&gt;&#xD;
&lt;/And&gt;&#xD;
&lt;/TypePattern.Match&gt;&#xD;
&#xD;
&lt;Entry DisplayName="Setup/Teardown Methods"&gt;&#xD;
&lt;Entry.Match&gt;&#xD;
&lt;And&gt;&#xD;
&lt;Kind Is="Method" /&gt;&#xD;
&lt;Or&gt;&#xD;
&lt;HasAttribute Name="NUnit.Framework.SetUpAttribute" Inherited="true" /&gt;&#xD;
&lt;HasAttribute Name="NUnit.Framework.TearDownAttribute" Inherited="true" /&gt;&#xD;
&lt;HasAttribute Name="NUnit.Framework.FixtureSetUpAttribute" Inherited="true" /&gt;&#xD;
&lt;HasAttribute Name="NUnit.Framework.FixtureTearDownAttribute" Inherited="true" /&gt;&#xD;
&lt;HasAttribute Name="NUnit.Framework.SetUpAttribute" Inherited="True" /&gt;&#xD;
&lt;HasAttribute Name="NUnit.Framework.TearDownAttribute" Inherited="True" /&gt;&#xD;
&lt;HasAttribute Name="NUnit.Framework.FixtureSetUpAttribute" Inherited="True" /&gt;&#xD;
&lt;HasAttribute Name="NUnit.Framework.FixtureTearDownAttribute" Inherited="True" /&gt;&#xD;
&lt;/Or&gt;&#xD;
&lt;/And&gt;&#xD;
&lt;/Entry.Match&gt;&#xD;
&lt;/Entry&gt;&#xD;
&#xD;
&lt;Entry DisplayName="All other members" /&gt;&#xD;
&#xD;
&lt;Entry DisplayName="Test Methods" Priority="100"&gt;&#xD;
&lt;Entry Priority="100" DisplayName="Test Methods"&gt;&#xD;
&lt;Entry.Match&gt;&#xD;
&lt;And&gt;&#xD;
&lt;Kind Is="Method" /&gt;&#xD;
&lt;HasAttribute Name="NUnit.Framework.TestAttribute" Inherited="false" /&gt;&#xD;
&lt;HasAttribute Name="NUnit.Framework.TestAttribute" /&gt;&#xD;
&lt;/And&gt;&#xD;
&lt;/Entry.Match&gt;&#xD;
&#xD;
&lt;Entry.SortBy&gt;&#xD;
&lt;Name /&gt;&#xD;
&lt;/Entry.SortBy&gt;&#xD;
&lt;/Entry&gt;&#xD;
&lt;/TypePattern&gt;&#xD;
&#xD;
&lt;TypePattern DisplayName="Default Pattern"&gt;&#xD;
&lt;Entry DisplayName="Public Delegates" Priority="100"&gt;&#xD;
&lt;Entry Priority="100" DisplayName="Public Delegates"&gt;&#xD;
&lt;Entry.Match&gt;&#xD;
&lt;And&gt;&#xD;
&lt;Access Is="Public" /&gt;&#xD;
&lt;Kind Is="Delegate" /&gt;&#xD;
&lt;/And&gt;&#xD;
&lt;/Entry.Match&gt;&#xD;
&#xD;
&lt;Entry.SortBy&gt;&#xD;
&lt;Name /&gt;&#xD;
&lt;/Entry.SortBy&gt;&#xD;
&lt;/Entry&gt;&#xD;
&#xD;
&lt;Entry DisplayName="Public Enums" Priority="100"&gt;&#xD;
&lt;Entry Priority="100" DisplayName="Public Enums"&gt;&#xD;
&lt;Entry.Match&gt;&#xD;
&lt;And&gt;&#xD;
&lt;Access Is="Public" /&gt;&#xD;
&lt;Kind Is="Enum" /&gt;&#xD;
&lt;/And&gt;&#xD;
&lt;/Entry.Match&gt;&#xD;
&#xD;
&lt;Entry.SortBy&gt;&#xD;
&lt;Name /&gt;&#xD;
&lt;/Entry.SortBy&gt;&#xD;
&lt;/Entry&gt;&#xD;
&#xD;
&lt;Entry DisplayName="Static Fields and Constants"&gt;&#xD;
&lt;Entry.Match&gt;&#xD;
&lt;Or&gt;&#xD;
Expand All @@ -235,17 +226,10 @@
&lt;/And&gt;&#xD;
&lt;/Or&gt;&#xD;
&lt;/Entry.Match&gt;&#xD;
&#xD;
&lt;Entry.SortBy&gt;&#xD;
&lt;Kind&gt;&#xD;
&lt;Kind.Order&gt;&#xD;
&lt;DeclarationKind&gt;Constant&lt;/DeclarationKind&gt;&#xD;
&lt;DeclarationKind&gt;Field&lt;/DeclarationKind&gt;&#xD;
&lt;/Kind.Order&gt;&#xD;
&lt;/Kind&gt;&#xD;
&lt;Kind Order="Constant Field" /&gt;&#xD;
&lt;/Entry.SortBy&gt;&#xD;
&lt;/Entry&gt;&#xD;
&#xD;
&lt;Entry DisplayName="Fields"&gt;&#xD;
&lt;Entry.Match&gt;&#xD;
&lt;And&gt;&#xD;
Expand All @@ -255,23 +239,19 @@
&lt;/Not&gt;&#xD;
&lt;/And&gt;&#xD;
&lt;/Entry.Match&gt;&#xD;
&#xD;
&lt;Entry.SortBy&gt;&#xD;
&lt;Readonly /&gt;&#xD;
&lt;Name /&gt;&#xD;
&lt;/Entry.SortBy&gt;&#xD;
&lt;/Entry&gt;&#xD;
&#xD;
&lt;Entry DisplayName="Constructors"&gt;&#xD;
&lt;Entry.Match&gt;&#xD;
&lt;Kind Is="Constructor" /&gt;&#xD;
&lt;/Entry.Match&gt;&#xD;
&#xD;
&lt;Entry.SortBy&gt;&#xD;
&lt;Static/&gt;&#xD;
&lt;Static /&gt;&#xD;
&lt;/Entry.SortBy&gt;&#xD;
&lt;/Entry&gt;&#xD;
&#xD;
&lt;Entry DisplayName="Properties, Indexers"&gt;&#xD;
&lt;Entry.Match&gt;&#xD;
&lt;Or&gt;&#xD;
Expand All @@ -280,30 +260,25 @@
&lt;/Or&gt;&#xD;
&lt;/Entry.Match&gt;&#xD;
&lt;/Entry&gt;&#xD;
&#xD;
&lt;Entry DisplayName="Interface Implementations" Priority="100"&gt;&#xD;
&lt;Entry Priority="100" DisplayName="Interface Implementations"&gt;&#xD;
&lt;Entry.Match&gt;&#xD;
&lt;And&gt;&#xD;
&lt;Kind Is="Member" /&gt;&#xD;
&lt;ImplementsInterface /&gt;&#xD;
&lt;/And&gt;&#xD;
&lt;/Entry.Match&gt;&#xD;
&#xD;
&lt;Entry.SortBy&gt;&#xD;
&lt;ImplementsInterface Immediate="true" /&gt;&#xD;
&lt;ImplementsInterface Immediate="True" /&gt;&#xD;
&lt;/Entry.SortBy&gt;&#xD;
&lt;/Entry&gt;&#xD;
&#xD;
&lt;Entry DisplayName="All other members" /&gt;&#xD;
&#xD;
&lt;Entry DisplayName="Nested Types"&gt;&#xD;
&lt;Entry.Match&gt;&#xD;
&lt;Kind Is="Type" /&gt;&#xD;
&lt;/Entry.Match&gt;&#xD;
&lt;/Entry&gt;&#xD;
&lt;/TypePattern&gt;&#xD;
&lt;/Patterns&gt;&#xD;
</s:String>
&lt;/Patterns&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/CSharpMemberOrderPattern/CustomPattern/@EntryValue">&lt;?xml version="1.0" encoding="utf-8" ?&gt;&#xD;
&#xD;
&lt;!--&#xD;
Expand Down Expand Up @@ -570,6 +545,7 @@ II.2.12 &lt;HandlesEvent /&gt;&#xD;
<s:String x:Key="/Default/CodeStyle/Naming/VBNaming/PredefinedNamingRules/=TypesAndNamespaces/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpFileLayoutPatternsUpgrade/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EAddAccessorOwnerDeclarationBracesMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EAlwaysTreatStructAsNotReorderableMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateThisQualifierSettings/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002EJavaScript_002ECodeStyle_002ESettingsUpgrade_002EJsCodeFormatterSettingsUpgrader/@EntryIndexedValue">True</s:Boolean>
Expand Down
9 changes: 4 additions & 5 deletions src/GitVersionCore.Tests/Fixtures/RepositoryFixtureBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,17 +124,16 @@ public void MergeNoFF(string mergeTarget)

public void AssertFullSemver(string fullSemver, IRepository repository = null, string commitId = null)
{
Trace.WriteLine("---------");
Console.WriteLine("---------");

var variables = GetVersion(repository, commitId);
try
{
var variables = GetVersion(repository, commitId);
variables.FullSemVer.ShouldBe(fullSemver);
}
catch (Exception)
{
if (repository != null)
repository.DumpGraph();
(repository ?? Repository).DumpGraph();
throw;
}
if (commitId == null)
Expand Down Expand Up @@ -164,7 +163,7 @@ VersionVariables GetVersion(IRepository repository = null, string commitId = nul
}
catch (Exception)
{
Trace.WriteLine("Test failing, dumping repository graph");
Console.WriteLine("Test failing, dumping repository graph");
gitVersionContext.Repository.DumpGraph();
throw;
}
Expand Down
2 changes: 1 addition & 1 deletion src/GitVersionCore.Tests/GitVersionContextBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public GitVersionContext Build()

IRepository CreateRepository()
{
var mockBranch = new MockBranch("master") { new MockCommit { CommitterEx = SignatureBuilder.SignatureNow() } };
var mockBranch = new MockBranch("master") { new MockCommit { CommitterEx = Constants.SignatureNow() } };
var mockRepository = new MockRepository
{
Branches = new MockBranchCollection
Expand Down
6 changes: 3 additions & 3 deletions src/GitVersionCore.Tests/GitVersionContextTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public void CanInheritVersioningMode(VersioningMode mode)
};
ConfigurationProvider.ApplyDefaultsTo(config);

var mockBranch = new MockBranch("master") { new MockCommit { CommitterEx = SignatureBuilder.SignatureNow() } };
var mockBranch = new MockBranch("master") { new MockCommit { CommitterEx = Constants.SignatureNow() } };
var mockRepository = new MockRepository
{
Branches = new MockBranchCollection
Expand Down Expand Up @@ -48,12 +48,12 @@ public void UsesBranchSpecificConfigOverTopLevelDefaults()
}
};
ConfigurationProvider.ApplyDefaultsTo(config);
var develop = new MockBranch("develop") { new MockCommit { CommitterEx = SignatureBuilder.SignatureNow() } };
var develop = new MockBranch("develop") { new MockCommit { CommitterEx = Constants.SignatureNow() } };
var mockRepository = new MockRepository
{
Branches = new MockBranchCollection
{
new MockBranch("master") { new MockCommit { CommitterEx = SignatureBuilder.SignatureNow() } },
new MockBranch("master") { new MockCommit { CommitterEx = Constants.SignatureNow() } },
develop
}
};
Expand Down
1 change: 0 additions & 1 deletion src/GitVersionCore.Tests/GitVersionCore.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@
<Compile Include="Mocks\MockTag.cs" />
<Compile Include="Mocks\MockTagAnnotation.cs" />
<Compile Include="Mocks\MockTagCollection.cs" />
<Compile Include="Mocks\SignatureBuilder.cs" />
<Compile Include="ModuleInitializer.cs" />
<Compile Include="Fixtures\EmptyRepositoryFixture.cs" />
<Compile Include="Helpers\GitTestExtensions.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public void ShouldInheritIncrementCorrectlyWithMultiplePossibleParentsAndWeirdly

//Merge it
fixture.Repository.Checkout("development");
fixture.Repository.Merge(feature123, SignatureBuilder.SignatureNow());
fixture.Repository.Merge(feature123, Constants.SignatureNow());

//Create a second feature branch
fixture.Repository.CreateBranch("feature/JIRA-124");
Expand Down Expand Up @@ -56,7 +56,7 @@ public void BranchCreatedAfterFastForwardMergeShouldInheritCorrectly()

//Merge it
fixture.Repository.Checkout("unstable");
fixture.Repository.Merge(feature123, SignatureBuilder.SignatureNow());
fixture.Repository.Merge(feature123, Constants.SignatureNow());

//Create a second feature branch
fixture.Repository.CreateBranch("feature/JIRA-124");
Expand Down Expand Up @@ -128,4 +128,32 @@ public void WhenTwoFeatureBranchPointToTheSameCommit()
fixture.AssertFullSemver("0.1.0-feature2.1+1");
}
}

[Test]
public void ShouldBePossibleToMergeDevelopForALongRunningBranchWhereDevelopAndMasterAreEqual()
{
using (var fixture = new EmptyRepositoryFixture(new Config() { VersioningMode = VersioningMode.ContinuousDeployment }))
{
fixture.Repository.MakeATaggedCommit("v1.0.0");

fixture.Repository.CreateBranch("develop");
fixture.Repository.Checkout("develop");

fixture.Repository.CreateBranch("feature/longrunning");
fixture.Repository.Checkout("feature/longrunning");
fixture.Repository.MakeACommit();

fixture.Repository.Checkout("develop");
fixture.Repository.MakeACommit();

fixture.Repository.Checkout("master");
fixture.Repository.Merge(fixture.Repository.FindBranch("develop"), Constants.SignatureNow());
fixture.Repository.ApplyTag("v1.1.0");

fixture.Repository.Checkout("feature/longrunning");
fixture.Repository.Merge(fixture.Repository.FindBranch("develop"), Constants.SignatureNow());

fixture.AssertFullSemver("1.2.0-longrunning.2");
}
}
}
15 changes: 0 additions & 15 deletions src/GitVersionCore.Tests/Mocks/SignatureBuilder.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class V1Strategy : BaseVersionStrategy

public V1Strategy(DateTimeOffset? when)
{
this.when = when == null ? null : new MockCommit { CommitterEx = when.Value.ToSignature() };
this.when = when == null ? null : new MockCommit { CommitterEx = Constants.Signature(when.Value) };
}

public override IEnumerable<BaseVersion> GetVersions(GitVersionContext context)
Expand All @@ -75,7 +75,7 @@ class V2Strategy : BaseVersionStrategy

public V2Strategy(DateTimeOffset? when)
{
this.when = when == null ? null : new MockCommit { CommitterEx = when.Value.ToSignature() };
this.when = when == null ? null : new MockCommit { CommitterEx = Constants.Signature(when.Value) };
}

public override IEnumerable<BaseVersion> GetVersions(GitVersionContext context)
Expand Down
Loading