Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
vCipher committed Nov 13, 2017
2 parents bd96a79 + f7ab328 commit fcf311a
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 2 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Cake.Hg
Cake AddIn that extends Cake with Mercurial features using Mercurial.Net

[![NuGet](https://img.shields.io/nuget/v/Cake.Hg.svg)](https://www.nuget.org/packages/Cake.Hg) [![MyGet](https://img.shields.io/myget/cake-contrib/vpre/Cake.Hg.svg?label=MyGet)](https://www.myget.org/feed/cake-contrib/package/nuget/Cake.Hg)

| Build server | Platform | Status |
|-----------------------------|--------------|---------------------------------------------------------------------------------------------------------------------------|
| AppVeyor | Windows | [![Build status](https://img.shields.io/appveyor/ci/cakecontrib/cake-hg/master.svg)](https://ci.appveyor.com/project/cakecontrib/cake-hg/branch/master) |

# Usage

```c#
Expand Down
33 changes: 33 additions & 0 deletions src/Cake.Hg/Aliases/HgAliases.Tip.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using System;
using Cake.Core;
using Cake.Core.Annotations;
using Cake.Core.IO;
using Mercurial;
// ReSharper disable MemberCanBePrivate.Global
// ReSharper disable UnusedMember.Global

namespace Cake.Hg.Aliases
{
public static partial class HgAliases
{
/// <summary>
/// Get the tip revision.
/// </summary>
/// <example>
/// <code>
/// var changeset = HgTip("./");
/// </code>
/// </example>
/// <param name="context">Cake context</param>
/// <param name="repositoryPath">Path to repository</param>
[CakeMethodAlias]
[CakeAliasCategory("Tip")]
public static Changeset HgTip(this ICakeContext context, DirectoryPath repositoryPath)
{
if (context == null) throw new ArgumentNullException(nameof(context));
if (repositoryPath == null) throw new ArgumentNullException(nameof(repositoryPath));

return context.Hg(repositoryPath).Tip();
}
}
}
4 changes: 2 additions & 2 deletions src/Cake.Hg/Cake.Hg.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
<Compile Include="Aliases\HgAliases.cs" />
<Compile Include="Aliases\HgAliases.Init.cs" />
<Compile Include="Aliases\HgAliases.Tag.cs" />
<Compile Include="Aliases\HgAliases.Tip.cs" />
<Compile Include="Aliases\HgAliases.Version.cs" />
<Compile Include="HgExtensions.cs" />
<Compile Include="Properties\Namespaces.cs" />
Expand All @@ -64,8 +65,7 @@
<ItemGroup>
<Compile Include="Aliases\HgAliases.Diff.cs" />
<None Include="packages.config" />
<Compile Include="$(SolutionDir)\SolutionInfo.cs"
Condition="Exists('$(SolutionDir)\SolutionInfo.cs')">
<Compile Include="$(SolutionDir)\SolutionInfo.cs" Condition="Exists('$(SolutionDir)\SolutionInfo.cs')">
<Link>Properties\SolutionInfo.cs</Link>
</Compile>
</ItemGroup>
Expand Down

0 comments on commit fcf311a

Please sign in to comment.