Skip to content
Browse files

Add support for OverrideGatedCheckIn

  • Loading branch information...
1 parent 9f79f18 commit 9cf08450c657f8ee1d23f3a306179fffb60906ae @vadimskipin vadimskipin committed Apr 3, 2012
View
1 GitTfs.Vs11/GitTfs.Vs11.csproj
@@ -75,6 +75,7 @@
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TfsHelper.Vs11.cs" />
<Compile Include="TfsPlugin.cs" />
+ <Compile Include="Wrappers.Vs11.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\GitTfs\GitTfs.csproj">
View
23 GitTfs.Vs11/Wrappers.Vs11.cs
@@ -0,0 +1,23 @@
+using System.Collections.Generic;
+using Microsoft.TeamFoundation.VersionControl.Client;
+using Sep.Git.Tfs.Core.TfsInterop;
+
+namespace Sep.Git.Tfs.VsCommon
+{
+ public partial class WrapperForWorkspace
+ {
+ public int Checkin(IPendingChange[] changes, string comment, ICheckinNote checkinNote, IEnumerable<IWorkItemCheckinInfo> workItemChanges,
+ TfsPolicyOverrideInfo policyOverrideInfo, bool overrideGatedCheckIn)
+ {
+ var checkinParameters = new WorkspaceCheckInParameters(_bridge.Unwrap<PendingChange>(changes), comment)
+ {
+ CheckinNotes = _bridge.Unwrap<CheckinNote>(checkinNote),
+ AssociatedWorkItems = _bridge.Unwrap<WorkItemCheckinInfo>(workItemChanges),
+ PolicyOverride = ToTfs(policyOverrideInfo),
+ OverrideGatedCheckIn = overrideGatedCheckIn
+ };
+
+ return _workspace.CheckIn(checkinParameters);
+ }
+ }
+}
View
13 GitTfs.Vs2008/GitTfs.Vs2008.csproj
@@ -123,6 +123,7 @@
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TfsHelper.Vs2008.cs" />
<Compile Include="TfsPlugin.cs" />
+ <Compile Include="Wrappers.Vs2008.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\GitTfs\GitTfs.csproj">
@@ -148,12 +149,12 @@
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
- Other similar extension points exist, see Microsoft.Common.targets.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target>
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
-->
<PropertyGroup>
<PostBuildEvent>xcopy /y "$(TargetDir)*.dll" "$(SolutionDir)GitTfs\$(OutDir)"</PostBuildEvent>
View
20 GitTfs.Vs2008/Wrappers.Vs2008.cs
@@ -0,0 +1,20 @@
+using System.Collections.Generic;
+using Microsoft.TeamFoundation.VersionControl.Client;
+using Sep.Git.Tfs.Core.TfsInterop;
+
+namespace Sep.Git.Tfs.VsCommon
+{
+ public partial class WrapperForWorkspace
+ {
+ public int Checkin(IPendingChange[] changes, string comment, ICheckinNote checkinNote, IEnumerable<IWorkItemCheckinInfo> workItemChanges,
+ TfsPolicyOverrideInfo policyOverrideInfo, bool overrideGatedCheckIn)
+ {
+ return _workspace.CheckIn(
+ _bridge.Unwrap<PendingChange>(changes),
+ comment,
+ _bridge.Unwrap<CheckinNote>(checkinNote),
+ _bridge.Unwrap<WorkItemCheckinInfo>(workItemChanges),
+ ToTfs(policyOverrideInfo));
+ }
+ }
+}
View
13 GitTfs.Vs2010/GitTfs.Vs2010.csproj
@@ -113,6 +113,7 @@
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TfsHelper.Vs2010.cs" />
<Compile Include="TfsPlugin.cs" />
+ <Compile Include="Wrappers.Vs2010.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\GitTfs\GitTfs.csproj">
@@ -138,12 +139,12 @@
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
- Other similar extension points exist, see Microsoft.Common.targets.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target>
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
-->
<PropertyGroup>
<PostBuildEvent>xcopy /y "$(TargetDir)*.dll" "$(SolutionDir)GitTfs\$(OutDir)"</PostBuildEvent>
View
23 GitTfs.Vs2010/Wrappers.Vs2010.cs
@@ -0,0 +1,23 @@
+using System.Collections.Generic;
+using Microsoft.TeamFoundation.VersionControl.Client;
+using Sep.Git.Tfs.Core.TfsInterop;
+
+namespace Sep.Git.Tfs.VsCommon
+{
+ public partial class WrapperForWorkspace
+ {
+ public int Checkin(IPendingChange[] changes, string comment, ICheckinNote checkinNote, IEnumerable<IWorkItemCheckinInfo> workItemChanges,
+ TfsPolicyOverrideInfo policyOverrideInfo, bool overrideGatedCheckIn)
+ {
+ var checkinParameters = new WorkspaceCheckInParameters(_bridge.Unwrap<PendingChange>(changes), comment)
+ {
+ CheckinNotes = _bridge.Unwrap<CheckinNote>(checkinNote),
+ AssociatedWorkItems = _bridge.Unwrap<WorkItemCheckinInfo>(workItemChanges),
+ PolicyOverride = ToTfs(policyOverrideInfo),
+ OverrideGatedCheckIn = overrideGatedCheckIn
+ };
+
+ return _workspace.CheckIn(checkinParameters);
+ }
+ }
+}
View
13 GitTfs.VsCommon/Wrappers.cs
@@ -379,7 +379,7 @@ public string Message
}
}
- public class WrapperForWorkspace : WrapperFor<Workspace>, IWorkspace
+ public partial class WrapperForWorkspace : WrapperFor<Workspace>, IWorkspace
{
private readonly TfsApiBridge _bridge;
private readonly Workspace _workspace;
@@ -400,17 +400,6 @@ public void Shelve(IShelveset shelveset, IPendingChange[] changes, TfsShelvingOp
_workspace.Shelve(_bridge.Unwrap<Shelveset>(shelveset), _bridge.Unwrap<PendingChange>(changes), _bridge.Convert<ShelvingOptions>(options));
}
- public int Checkin(IPendingChange[] changes, string comment, ICheckinNote checkinNote, IEnumerable<IWorkItemCheckinInfo> workItemChanges,
- TfsPolicyOverrideInfo policyOverrideInfo)
- {
- return _workspace.CheckIn(
- _bridge.Unwrap<PendingChange>(changes),
- comment,
- _bridge.Unwrap<CheckinNote>(checkinNote),
- _bridge.Unwrap<WorkItemCheckinInfo>(workItemChanges),
- ToTfs(policyOverrideInfo));
- }
-
private PolicyOverrideInfo ToTfs(TfsPolicyOverrideInfo policyOverrideInfo)
{
if (policyOverrideInfo == null)
View
3 GitTfs/Commands/CheckinOptions.cs
@@ -25,6 +25,8 @@ public OptionSet OptionSet
{ "w|work-item=:", "Associated work items\ne.g. -w12345 to associate with 12345\nor -w12345:resolve to resolve 12345",
(n, opt) => { if(n == null) throw new OptionException("Missing work item number for option -w.", "-w");
(opt == "resolve" ? WorkItemsToResolve : WorkItemsToAssociate).Add(n); } },
+ { "no-gate", "Disables gated checkin.",
+ v => { OverrideGatedCheckIn = true; } },
};
}
}
@@ -38,6 +40,7 @@ public OptionSet OptionSet
public bool NoMerge { get; set; }
public string OverrideReason { get; set; }
public bool Force { get; set; }
+ public bool OverrideGatedCheckIn { get; set; }
public List<string> WorkItemsToAssociate { get { return _workItemsToAssociate; } }
public List<string> WorkItemsToResolve { get { return _workItemsToResolve; } }
}
View
2 GitTfs/Core/TfsInterop/IWorkspace.cs
@@ -7,7 +7,7 @@ public interface IWorkspace
IPendingChange[] GetPendingChanges();
ICheckinEvaluationResult EvaluateCheckin(TfsCheckinEvaluationOptions options, IPendingChange[] allChanges, IPendingChange[] changes, string comment, ICheckinNote checkinNote, IEnumerable<IWorkItemCheckinInfo> workItemChanges);
void Shelve(IShelveset shelveset, IPendingChange[] changes, TfsShelvingOptions options);
- int Checkin(IPendingChange[] changes, string comment, ICheckinNote checkinNote, IEnumerable<IWorkItemCheckinInfo> workItemChanges, TfsPolicyOverrideInfo policyOverrideInfo);
+ int Checkin(IPendingChange[] changes, string comment, ICheckinNote checkinNote, IEnumerable<IWorkItemCheckinInfo> workItemChanges, TfsPolicyOverrideInfo policyOverrideInfo, bool overrideGatedCheckIn);
int PendAdd(string path);
int PendEdit(string path);
int PendDelete(string path);
View
2 GitTfs/Core/TfsWorkspace.cs
@@ -93,7 +93,7 @@ public long Checkin()
}
var policyOverride = GetPolicyOverrides(checkinProblems.Result);
- var newChangeset = _workspace.Checkin(pendingChanges, _checkinOptions.CheckinComment, null, workItemInfos, policyOverride);
+ var newChangeset = _workspace.Checkin(pendingChanges, _checkinOptions.CheckinComment, null, workItemInfos, policyOverride, _checkinOptions.OverrideGatedCheckIn);
if(newChangeset == 0)
{
throw new GitTfsException("Checkin failed!");

0 comments on commit 9cf0845

Please sign in to comment.
Something went wrong with that request. Please try again.