Short-circuit checkintool if the checkin dialog isn't available.
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user