forked from git-tfs/git-tfs
-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
8ec901a
commit ed1c171
Showing
4 changed files
with
70 additions
and
0 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,49 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel; | ||
using System.Linq; | ||
using CommandLine.OptParse; | ||
using Sep.Git.Tfs.Core; | ||
using Sep.Git.Tfs.Core.TfsInterop; | ||
using StructureMap; | ||
|
||
namespace Sep.Git.Tfs.Commands | ||
{ | ||
[Pluggable("unshelve")] | ||
[Description("unshelve [options] (-l | shelveset-name [ref-to-shelve]")] | ||
[RequiresValidGitRepository] | ||
public class Unshelve : GitTfsCommand | ||
{ | ||
private readonly Globals _globals; | ||
|
||
public Unshelve(Globals globals) | ||
{ | ||
_globals = globals; | ||
} | ||
[OptDef(OptValType.Flag)] | ||
[ShortOptionName('l')] | ||
[UseNameAsLongOption(false)] | ||
[Description("List available shelvesets")] | ||
public bool List { get; set; } | ||
|
||
[OptDef(OptValType.ValueReq)] | ||
[ShortOptionName('u')] | ||
[LongOptionName("user")] | ||
[UseNameAsLongOption(false)] | ||
[Description("Shelveset owner (default is the current user; 'all' means all users)")] | ||
public string Owner { get; set; } | ||
|
||
public IEnumerable<IOptionResults> ExtraOptions | ||
{ | ||
get { return this.MakeNestedOptionResults(); } | ||
} | ||
|
||
public int Run(IList<string> args) | ||
{ | ||
// TODO -- let the remote be specified on the command line. | ||
var remote = _globals.Repository.ReadAllTfsRemotes().First(); | ||
remote.Tfs.Unshelve(this, args); | ||
return GitTfsExitCodes.OK; | ||
} | ||
} | ||
} |
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