Short-circuit checkintool if the checkin dialog isn't available.

This commit is contained in:
Matt Burke
2011-01-27 14:52:53 -05:00
parent 5adae0d3db
commit ff77e67cf7
4 changed files with 11 additions and 1 deletions
+2
View File
@@ -14,6 +14,8 @@ namespace Sep.Git.Tfs.VsCommon
get { return typeof(TeamFoundationServer).Assembly.GetName().Version.ToString() + " (MS)"; }
}
public bool CanShowCheckinDialog { get { return false; } }
public bool ShowCheckinDialog(IWorkspace workspace, IPendingChange[] pendingChanges, IEnumerable<IWorkItemCheckedInfo> checkedInfos, string checkinComment)
{
throw new NotImplementedException();
+2
View File
@@ -41,6 +41,8 @@ namespace Sep.Git.Tfs.VsCommon
}
}
public bool CanShowCheckinDialog { get { return true; } }
public bool ShowCheckinDialog(IWorkspace workspace, IPendingChange[] pendingChanges,
IEnumerable<IWorkItemCheckedInfo> checkedInfos, string checkinComment)
{
+6 -1
View File
@@ -35,7 +35,12 @@ namespace Sep.Git.Tfs.Commands
{
return _writer.Write(refToCheckin, changeset =>
{
changeset.Remote.CheckinTool(refToCheckin, changeset);
if (changeset.Remote.Tfs.CanShowCheckinDialog)
changeset.Remote.CheckinTool(refToCheckin, changeset);
else
throw new Exception(
"checkintool does not work with this TFS version (" + changeset.Remote.Tfs.TfsClientLibraryVersion + ").",
new[] {"Try installing the VS2010 edition of Team Explorer."});
return GitTfsExitCodes.OK;
});
}
+1
View File
@@ -18,6 +18,7 @@ namespace Sep.Git.Tfs.Core.TfsInterop
IChangeset GetChangeset(int changesetId);
bool MatchesUrl(string tfsUrl);
bool HasShelveset(string shelvesetName);
bool CanShowCheckinDialog { get; }
bool ShowCheckinDialog(IWorkspace workspace, IPendingChange[] pendingChanges, IEnumerable<IWorkItemCheckedInfo> checkedInfos, string checkinComment);
}
}