Skip to content

Commit be72b5d

Browse files
committed
Merge pull request #824 from GitTools/updateRefs
Update refs
2 parents 39422c6 + adcf9bf commit be72b5d

24 files changed

+82
-63
lines changed

src/GitVersionCore.Tests/GitVersionCore.Tests.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838
<DebugSymbols>true</DebugSymbols>
3939
</PropertyGroup>
4040
<ItemGroup>
41-
<Reference Include="FluentDateTime, Version=1.12.0.0, Culture=neutral, PublicKeyToken=6ccbc613702e6c71, processorArchitecture=MSIL">
42-
<HintPath>..\packages\FluentDateTime.1.12.0\Lib\NET35\FluentDateTime.dll</HintPath>
41+
<Reference Include="FluentDateTime, Version=1.13.0.0, Culture=neutral, PublicKeyToken=6ccbc613702e6c71, processorArchitecture=MSIL">
42+
<HintPath>..\packages\FluentDateTime.1.13.0\lib\NET35\FluentDateTime.dll</HintPath>
4343
<Private>True</Private>
4444
</Reference>
4545
<Reference Include="GitTools.Core, Version=0.4.0.0, Culture=neutral, processorArchitecture=MSIL">
@@ -193,8 +193,8 @@
193193
<PropertyGroup>
194194
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
195195
</PropertyGroup>
196-
<Error Condition="!Exists('..\packages\Fody.1.29.3\build\portable-net+sl+win+wpa+wp\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.1.29.3\build\portable-net+sl+win+wpa+wp\Fody.targets'))" />
197196
<Error Condition="!Exists('..\packages\LibGit2Sharp.NativeBinaries.1.0.129\build\LibGit2Sharp.NativeBinaries.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\LibGit2Sharp.NativeBinaries.1.0.129\build\LibGit2Sharp.NativeBinaries.props'))" />
197+
<Error Condition="!Exists('..\packages\Fody.1.29.4\build\dotnet\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.1.29.4\build\dotnet\Fody.targets'))" />
198198
</Target>
199-
<Import Project="..\packages\Fody.1.29.3\build\portable-net+sl+win+wpa+wp\Fody.targets" Condition="Exists('..\packages\Fody.1.29.3\build\portable-net+sl+win+wpa+wp\Fody.targets')" />
199+
<Import Project="..\packages\Fody.1.29.4\build\dotnet\Fody.targets" Condition="Exists('..\packages\Fody.1.29.4\build\dotnet\Fody.targets')" />
200200
</Project>

src/GitVersionCore.Tests/IntegrationTests/HotfixBranchScenarios.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public void CanTakeVersionFromHotfixesBranch()
5757

5858
// Merge hotfix branch to support
5959
fixture.Repository.Checkout("master");
60-
fixture.Repository.Checkout(fixture.Repository.CreateBranch("support-1.1", (Commit)fixture.Repository.Tags.Single(t => t.Name == "1.1.0").Target));
60+
fixture.Repository.Checkout(fixture.Repository.CreateBranch("support-1.1", (Commit)fixture.Repository.Tags.Single(t => t.FriendlyName == "1.1.0").Target));
6161
fixture.AssertFullSemver("1.1.0");
6262

6363
// create hotfix branch

src/GitVersionCore.Tests/Mocks/MockBranch.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public MockBranch()
2323
MockCommitLog commits = new MockCommitLog();
2424
string name;
2525
string canonicalName;
26-
public override string Name { get { return name; } }
26+
public override string FriendlyName { get { return name; } }
2727
public override ICommitLog Commits { get { return commits; } }
2828
public override Commit Tip { get { return commits.First(); } }
2929
public override bool IsTracking { get { return true; } }

src/GitVersionCore.Tests/Mocks/MockBranchCollection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public override IEnumerator<Branch> GetEnumerator()
1313

1414
public override Branch this[string name]
1515
{
16-
get { return Branches.FirstOrDefault(x => x.Name == name); }
16+
get { return Branches.FirstOrDefault(x => x.FriendlyName == name); }
1717
}
1818

1919
public void Add(Branch item)

src/GitVersionCore.Tests/Mocks/MockTag.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ public class MockTag : Tag
44
{
55

66
public string NameEx;
7-
public override string Name
7+
public override string FriendlyName
88
{
99
get { return NameEx; }
1010
}

src/GitVersionCore.Tests/packages.config

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="FluentDateTime" version="1.12.0" targetFramework="net45" />
4-
<package id="Fody" version="1.29.3" targetFramework="net45" developmentDependency="true" />
3+
<package id="FluentDateTime" version="1.13.0" targetFramework="net45" />
4+
<package id="Fody" version="1.29.4" targetFramework="net45" developmentDependency="true" />
55
<package id="GitTools.Core" version="0.4.0-beta0004" targetFramework="net45" />
66
<package id="GitTools.Testing" version="1.1.0" targetFramework="net45" />
77
<package id="LibGit2Sharp" version="0.22.0" targetFramework="net45" />
88
<package id="LibGit2Sharp.NativeBinaries" version="1.0.129" targetFramework="net45" />
9-
<package id="ModuleInit.Fody" version="1.5.8.0" targetFramework="net45" developmentDependency="true" />
9+
<package id="ModuleInit.Fody" version="1.5.9.0" targetFramework="net45" developmentDependency="true" />
1010
<package id="NSubstitute" version="1.10.0.0" targetFramework="net45" />
1111
<package id="NUnit" version="2.6.4" targetFramework="net45" />
1212
<package id="NUnitTestAdapter" version="2.0.0" targetFramework="net45" />

src/GitVersionCore/BranchConfigurationCalculator.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public static KeyValuePair<string, BranchConfig> GetBranchConfiguration(Commit c
3535
}
3636

3737
const string format = "Multiple branch configurations match the current branch branchName of '{0}'. Matching configurations: '{1}'";
38-
throw new Exception(string.Format(format, currentBranch.Name, string.Join(", ", matchingBranches.Select(b => b.Key))));
38+
throw new Exception(string.Format(format, currentBranch.FriendlyName, string.Join(", ", matchingBranches.Select(b => b.Key))));
3939
}
4040

4141
static KeyValuePair<string, BranchConfig>[] LookupBranchConfiguration([NotNull] Config config, [NotNull] Branch currentBranch)
@@ -50,7 +50,7 @@ static KeyValuePair<string, BranchConfig>[] LookupBranchConfiguration([NotNull]
5050
throw new ArgumentNullException("currentBranch");
5151
}
5252

53-
return config.Branches.Where(b => Regex.IsMatch(currentBranch.Name, "^" + b.Key, RegexOptions.IgnoreCase)).ToArray();
53+
return config.Branches.Where(b => Regex.IsMatch(currentBranch.FriendlyName, "^" + b.Key, RegexOptions.IgnoreCase)).ToArray();
5454
}
5555

5656

@@ -104,7 +104,7 @@ static KeyValuePair<string, BranchConfig> InheritBranchConfiguration(bool onlyEv
104104
}
105105
}
106106

107-
Logger.WriteInfo("Found possible parent branches: " + string.Join(", ", possibleParents.Select(p => p.Name)));
107+
Logger.WriteInfo("Found possible parent branches: " + string.Join(", ", possibleParents.Select(p => p.FriendlyName)));
108108

109109
if (possibleParents.Count == 1)
110110
{
@@ -124,14 +124,14 @@ static KeyValuePair<string, BranchConfig> InheritBranchConfiguration(bool onlyEv
124124
if (possibleParents.Count == 0)
125125
errorMessage = "Failed to inherit Increment branch configuration, no branches found.";
126126
else
127-
errorMessage = "Failed to inherit Increment branch configuration, ended up with: " + string.Join(", ", possibleParents.Select(p => p.Name));
127+
errorMessage = "Failed to inherit Increment branch configuration, ended up with: " + string.Join(", ", possibleParents.Select(p => p.FriendlyName));
128128

129-
var chosenBranch = repository.Branches.FirstOrDefault(b => Regex.IsMatch(b.Name, "^develop", RegexOptions.IgnoreCase)
130-
|| Regex.IsMatch(b.Name, "master$", RegexOptions.IgnoreCase));
129+
var chosenBranch = repository.Branches.FirstOrDefault(b => Regex.IsMatch(b.FriendlyName, "^develop", RegexOptions.IgnoreCase)
130+
|| Regex.IsMatch(b.FriendlyName, "master$", RegexOptions.IgnoreCase));
131131
if (chosenBranch == null)
132132
throw new InvalidOperationException("Could not find a 'develop' or 'master' branch, neither locally nor remotely.");
133133

134-
var branchName = chosenBranch.Name;
134+
var branchName = chosenBranch.FriendlyName;
135135
Logger.WriteWarning(errorMessage + Environment.NewLine + Environment.NewLine + "Falling back to " + branchName + " branch config");
136136

137137
var value = GetBranchConfiguration(currentCommit, repository, onlyEvaluateTrackedBranches, config, chosenBranch).Value;
@@ -161,22 +161,22 @@ static Branch[] CalculateWhenMultipleParents(IRepository repository, Commit curr
161161
}
162162
else if (branches.Count > 1)
163163
{
164-
currentBranch = branches.FirstOrDefault(b => b.Name == "master") ?? branches.First();
164+
currentBranch = branches.FirstOrDefault(b => b.FriendlyName == "master") ?? branches.First();
165165
}
166166
else
167167
{
168168
var possibleTargetBranches = repository.Branches.Where(b => !b.IsRemote && b.Tip == parents[0]).ToList();
169169
if (possibleTargetBranches.Count > 1)
170170
{
171-
currentBranch = possibleTargetBranches.FirstOrDefault(b => b.Name == "master") ?? possibleTargetBranches.First();
171+
currentBranch = possibleTargetBranches.FirstOrDefault(b => b.FriendlyName == "master") ?? possibleTargetBranches.First();
172172
}
173173
else
174174
{
175175
currentBranch = possibleTargetBranches.FirstOrDefault() ?? currentBranch;
176176
}
177177
}
178178

179-
Logger.WriteInfo("HEAD is merge commit, this is likely a pull request using " + currentBranch.Name + " as base");
179+
Logger.WriteInfo("HEAD is merge commit, this is likely a pull request using " + currentBranch.FriendlyName + " as base");
180180

181181
return excludedBranches;
182182
}

src/GitVersionCore/GitVersionContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public GitVersionContext(IRepository repository, Branch currentBranch, Config co
6161
.SelectMany(t =>
6262
{
6363
SemanticVersion version;
64-
if (t.PeeledTarget() == CurrentCommit && SemanticVersion.TryParse(t.Name, Configuration.GitTagPrefix, out version))
64+
if (t.PeeledTarget() == CurrentCommit && SemanticVersion.TryParse(t.FriendlyName, Configuration.GitTagPrefix, out version))
6565
return new[] { version };
6666
return new SemanticVersion[0];
6767
})

src/GitVersionCore/GitVersionCore.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@
5858
<Reference Include="Microsoft.CSharp" />
5959
<Reference Include="System.Data" />
6060
<Reference Include="System.Xml" />
61-
<Reference Include="Visualize, Version=0.4.4.0, Culture=neutral, processorArchitecture=MSIL">
62-
<HintPath>..\packages\Visualize.Fody.0.4.4.0\lib\portable-net4+sl4+wp7+win8+MonoAndroid16+MonoTouch40\Visualize.dll</HintPath>
61+
<Reference Include="Visualize, Version=0.4.5.0, Culture=neutral, processorArchitecture=MSIL">
62+
<HintPath>..\packages\Visualize.Fody.0.4.5.0\lib\portable-net4+sl4+wp7+win8+MonoAndroid16+MonoTouch40\Visualize.dll</HintPath>
6363
<Private>False</Private>
6464
</Reference>
6565
<Reference Include="YamlDotNet, Version=3.8.0.0, Culture=neutral, processorArchitecture=MSIL">
@@ -183,8 +183,8 @@
183183
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
184184
</PropertyGroup>
185185
<Error Condition="!Exists('..\packages\PepitaPackage.1.21.4\build\PepitaPackage.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\PepitaPackage.1.21.4\build\PepitaPackage.targets'))" />
186-
<Error Condition="!Exists('..\packages\Fody.1.29.3\build\portable-net+sl+win+wpa+wp\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.1.29.3\build\portable-net+sl+win+wpa+wp\Fody.targets'))" />
187186
<Error Condition="!Exists('..\packages\LibGit2Sharp.NativeBinaries.1.0.129\build\LibGit2Sharp.NativeBinaries.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\LibGit2Sharp.NativeBinaries.1.0.129\build\LibGit2Sharp.NativeBinaries.props'))" />
187+
<Error Condition="!Exists('..\packages\Fody.1.29.4\build\portable-net+sl+win+wpa+wp\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.1.29.4\build\portable-net+sl+win+wpa+wp\Fody.targets'))" />
188188
</Target>
189189
<PropertyGroup>
190190
<PostBuildEvent>
@@ -207,5 +207,5 @@
207207
<PepitaPackage.CreatePackageTask NuGetBuildDirectory="$(BuildDir)NuGetRefBuild" MetadataAssembly="$(OutputPath)GitVersionCore.dll" Version="$(GitVersion_NuGetVersion)" />
208208
</Target>
209209
<Import Project="..\packages\PepitaPackage.1.21.4\build\PepitaPackage.targets" Condition="Exists('..\packages\PepitaPackage.1.21.4\build\PepitaPackage.targets')" />
210-
<Import Project="..\packages\Fody.1.29.3\build\portable-net+sl+win+wpa+wp\Fody.targets" Condition="Exists('..\packages\Fody.1.29.3\build\portable-net+sl+win+wpa+wp\Fody.targets')" />
210+
<Import Project="..\packages\Fody.1.29.4\build\portable-net+sl+win+wpa+wp\Fody.targets" Condition="Exists('..\packages\Fody.1.29.4\build\portable-net+sl+win+wpa+wp\Fody.targets')" />
211211
</Project>

src/GitVersionCore/GitVersionFinder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public class GitVersionFinder
88
{
99
public SemanticVersion FindVersion(GitVersionContext context)
1010
{
11-
Logger.WriteInfo(string.Format("Running against branch: {0} ({1})", context.CurrentBranch.Name, context.CurrentCommit.Sha));
11+
Logger.WriteInfo(string.Format("Running against branch: {0} ({1})", context.CurrentBranch.FriendlyName, context.CurrentCommit.Sha));
1212
EnsureMainTopologyConstraints(context);
1313

1414
var filePath = Path.Combine(context.Repository.GetRepositoryDirectory(), "NextVersion.txt");

src/GitVersionCore/IncrementStrategyFinder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ private static IEnumerable<Commit> GetIntermediateCommits(IRepository repo, Comm
8787
{
8888
var filter = new CommitFilter
8989
{
90-
Since = headCommit,
90+
IncludeReachableFrom = headCommit,
9191
SortBy = CommitSortStrategies.Topological | CommitSortStrategies.Reverse
9292
};
9393

src/GitVersionCore/VersionCalculation/BaseVersionCalculators/TaggedCommitVersionStrategy.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ public override IEnumerable<BaseVersion> GetVersions(GitVersionContext context)
2121
.Select(t =>
2222
{
2323
SemanticVersion version;
24-
if (SemanticVersion.TryParse(t.Name, context.Configuration.GitTagPrefix, out version))
24+
if (SemanticVersion.TryParse(t.FriendlyName, context.Configuration.GitTagPrefix, out version))
2525
{
2626
var commit = t.PeeledTarget() as Commit;
2727
if (commit != null)
28-
return new VersionTaggedCommit(commit, version, t.Name);
28+
return new VersionTaggedCommit(commit, version, t.FriendlyName);
2929
}
3030
return null;
3131
})

src/GitVersionCore/VersionCalculation/BaseVersionCalculators/VersionInBranchBaseVersionStrategy.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ public override IEnumerable<BaseVersion> GetVersions(GitVersionContext context)
1111
if (versionInBranch != null)
1212
{
1313
var commitBranchWasBranchedFrom = context.CurrentBranch.FindCommitBranchWasBranchedFrom(context.Repository);
14-
var branchNameOverride = context.CurrentBranch.Name.RegexReplace("[-/]" + versionInBranch.Item1, string.Empty);
14+
var branchNameOverride = context.CurrentBranch.FriendlyName.RegexReplace("[-/]" + versionInBranch.Item1, string.Empty);
1515
yield return new BaseVersion("Version in branch name", false, versionInBranch.Item2, commitBranchWasBranchedFrom, branchNameOverride);
1616
}
1717
}
1818

1919
Tuple<string, SemanticVersion> GetVersionInBranch(GitVersionContext context)
2020
{
21-
var branchParts = context.CurrentBranch.Name.Split('/', '-');
21+
var branchParts = context.CurrentBranch.FriendlyName.Split('/', '-');
2222
foreach (var part in branchParts)
2323
{
2424
SemanticVersion semanticVersion;

src/GitVersionCore/VersionCalculation/FallbackBaseVersionStrategy.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public override IEnumerable<BaseVersion> GetVersions(GitVersionContext context)
1111
{
1212
var baseVersionSource = context.Repository.Commits.QueryBy(new CommitFilter
1313
{
14-
Since = context.CurrentBranch.Tip
14+
IncludeReachableFrom = context.CurrentBranch.Tip
1515
}).First(c => !c.Parents.Any());
1616
yield return new BaseVersion("Fallback base version", false, new SemanticVersion(minor: 1), baseVersionSource, null);
1717
}

src/GitVersionCore/VersionCalculation/MetaDataCalculator.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ public SemanticVersionBuildMetaData Create(Commit baseVersionSource, GitVersionC
99
{
1010
var qf = new CommitFilter
1111
{
12-
Since = context.CurrentCommit,
13-
Until = baseVersionSource,
12+
IncludeReachableFrom = context.CurrentCommit,
13+
ExcludeReachableFrom = baseVersionSource,
1414
SortBy = CommitSortStrategies.Topological | CommitSortStrategies.Time
1515
};
1616

@@ -20,7 +20,7 @@ public SemanticVersionBuildMetaData Create(Commit baseVersionSource, GitVersionC
2020

2121
return new SemanticVersionBuildMetaData(
2222
commitsSinceTag,
23-
context.CurrentBranch.Name,
23+
context.CurrentBranch.FriendlyName,
2424
context.CurrentCommit.Sha,
2525
context.CurrentCommit.When());
2626
}

src/GitVersionCore/VersionCalculation/NextVersionCalculator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ void UpdatePreReleaseTag(GitVersionContext context, SemanticVersion semanticVers
7777
{
7878
Logger.WriteInfo("Using branch name to calculate version tag");
7979

80-
var branchName = branchNameOverride ?? context.CurrentBranch.Name;
80+
var branchName = branchNameOverride ?? context.CurrentBranch.FriendlyName;
8181
if (!string.IsNullOrWhiteSpace(context.Configuration.BranchPrefixToTrim))
8282
{
8383
branchName = branchName.RegexReplace(context.Configuration.BranchPrefixToTrim, string.Empty, RegexOptions.IgnoreCase);

src/GitVersionCore/VersioningModes/ContinuousDeliveryMode.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ static SemanticVersionPreReleaseTag RetrieveMostRecentOptionalTagVersion(GitVers
1616
if (applicableTagsInDescendingOrder.Any())
1717
{
1818
var taggedCommit = applicableTagsInDescendingOrder.First().PeeledTarget();
19-
var preReleaseVersion = applicableTagsInDescendingOrder.Select(tag => SemanticVersion.Parse(tag.Name, context.Configuration.GitTagPrefix)).FirstOrDefault();
19+
var preReleaseVersion = applicableTagsInDescendingOrder.Select(tag => SemanticVersion.Parse(tag.FriendlyName, context.Configuration.GitTagPrefix)).FirstOrDefault();
2020
if (preReleaseVersion != null)
2121
{
2222
if (taggedCommit != context.CurrentCommit)

src/GitVersionCore/packages.config

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Caseless.Fody" version="1.3.7" targetFramework="net4" developmentDependency="true" />
4-
<package id="Fody" version="1.29.3" targetFramework="net4" developmentDependency="true" />
3+
<package id="Caseless.Fody" version="1.4.1" targetFramework="net40" developmentDependency="true" />
4+
<package id="Fody" version="1.29.4" targetFramework="net40" developmentDependency="true" />
55
<package id="GitTools.Core" version="0.4.0-beta0004" targetFramework="net40" />
66
<package id="JetBrainsAnnotations.Fody" version="1.0.4.0" targetFramework="net4" developmentDependency="true" />
77
<package id="LibGit2Sharp" version="0.22.0" targetFramework="net40" />
88
<package id="LibGit2Sharp.NativeBinaries" version="1.0.129" targetFramework="net40" />
99
<package id="PepitaPackage" version="1.21.4" targetFramework="net4" developmentDependency="true" />
10-
<package id="Visualize.Fody" version="0.4.4.0" targetFramework="net4" developmentDependency="true" />
10+
<package id="Visualize.Fody" version="0.4.5.0" targetFramework="net40" developmentDependency="true" />
1111
<package id="YamlDotNet" version="3.8.0" targetFramework="net40" />
1212
</packages>

0 commit comments

Comments
 (0)