-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
41 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters