Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Detect TEE CLC not recogizing workspace created by TF.exe #229

Merged
merged 1 commit into from
May 15, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion TFVC_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ Studio Code Settings (**File > Preferences > Settings**):

## Frequently Asked Questions
### *Is it required that I have a TFVC workspace already on my local machine to use the TFVC support?*
With release 1.116.0, yes, it is a requirement that you have an existing workspace on your local machine.
Since release 1.116.0, yes, it is a requirement that you have an existing workspace on your local machine.

### *Can I use the Team Explorer Everywhere Command Line Client (TEE CLC) to provide the TFVC functionality on Windows?*
Yes. If you use Eclipse or one of JetBrain's IDEs (e.g, Android Studio, IntelliJ) on Windows, then you will want to use the TEE CLC to provide
Expand All @@ -216,6 +216,15 @@ You will follow the same instructions for setting up the TEE CLC as is shown on
### *I have workspaces created with Visual Studio. Can I use the TEE CLC to work with them?*
This should be possible. However, you will need to make the TEE CLC aware of those workspaces by running the `tf workspaces -collection:<collection-url>` command.

### *Using the TEE CLC, I am unable to access an existing local workspace. What can I do?*
This error may mean you are attempting to access a workspace created by TF.exe from the TEE CLC. First, using the CLC, run the `tf workspaces` command as detailed [here](#i-have-workspaces-created-with-visual-studio-can-i-use-the-tee-clc-to-work-with-them)
to help the CLC be aware of the workspaces in the specified collection. You may also need to run the `tf workfold` command from the local folder being accessed from Visual Studio Code. Running both commands should make the TEE CLC aware of the workspace and
as well as verify that access to it is possible.

### *My TFS server requires associating work items to a check-in via check-in policies but I can't check in with TF.exe. What can I do?*
Unfortunately, TF.exe doesn't provide the ability to associate work items on check in. The most TF.exe can do is submit a check in *comment* with a reference to the work item (which will not actually associate the work item). In order to enable checking in to
servers that have check-in policies enabled, you must use the TEE CLC (which does provide support for associating work items on check-in). Follow [these instructions](#how-do-i-set-up-the-clc-on-windows) to set up the TEE CLC on Windows.

### *Where is the support for Server workspaces?*
At this time, it's still on the backlog. The issue tracking support for Server workspaces is [here](https://github.com/Microsoft/vsts-vscode/issues/176).

Expand Down
11 changes: 8 additions & 3 deletions src/extensionmanager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,12 @@ export class ExtensionManager implements Disposable {
});
}
} catch (err) {
Logger.LogError(err.message);
//For now, don't report these errors via the _feedbackClient
let logMsg: string = err.message;
if (err.stderr) { //Add stderr to logged message if we have it
logMsg = Utils.FormatMessage(`${logMsg} ${err.stderr}`);
}
Logger.LogError(logMsg);
//For now, don't report these errors via the FeedbackClient
if (!err.tfvcErrorCode || this.shouldDisplayTfvcError(err.tfvcErrorCode)) {
this.setErrorStatus(err.message, undefined, false);
VsCodeUtils.ShowErrorMessage(err.message, ...err.messageOptions);
Expand Down Expand Up @@ -405,7 +409,8 @@ export class ExtensionManager implements Disposable {
if (TfvcErrorCodes.MinVersionWarning === errorCode ||
TfvcErrorCodes.NotFound === errorCode ||
TfvcErrorCodes.NotAuthorizedToAccess === errorCode ||
TfvcErrorCodes.NotAnEnuTfCommandLine === errorCode) {
TfvcErrorCodes.NotAnEnuTfCommandLine === errorCode ||
TfvcErrorCodes.WorkspaceNotKnownToClc === errorCode) {
return true;
}
return false;
Expand Down
3 changes: 3 additions & 0 deletions src/helpers/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export class Constants {
static ReadmeLearnMoreUrl: string = "https://aka.ms/jkapah";
static ServerWorkspaceUrl: string = "https://github.com/Microsoft/vsts-vscode/blob/master/TFVC_README.md#what-is-the-difference-between-a-local-and-server-workspace-how-can-i-tell-which-one-im-working-with";
static VS2015U3CSRUrl: string = "https://msdn.microsoft.com/en-us/library/mt752379.aspx";
static WorkspaceNotDetectedByClcUrl: string = "https://github.com/Microsoft/vsts-vscode/blob/master/TFVC_README.md#using-the-tee-clc-i-am-unable-to-access-an-existing-local-workspace-what-can-i-do";
}

export class CommandNames {
Expand Down Expand Up @@ -128,6 +129,7 @@ class TfvcBaseTelemetryEvents {
static Sync: string = "sync";
static Undo: string = "undo";
static UndoAll: string = "undoall";
static WorkspaceAccessError: string = "workspaceaccesserror";
}

export class TfvcTelemetryEvents {
Expand Down Expand Up @@ -162,6 +164,7 @@ export class TfvcTelemetryEvents {
static UndoClc: string = TfvcTelemetryEvents.UsingClc + "-" + TfvcBaseTelemetryEvents.Undo;
static UndoAllExe: string = TfvcTelemetryEvents.UsingExe + "-" + TfvcBaseTelemetryEvents.UndoAll;
static UndoAllClc: string = TfvcTelemetryEvents.UsingClc + "-" + TfvcBaseTelemetryEvents.UndoAll;
static ClcCannotAccessWorkspace: string = TfvcTelemetryEvents.UsingClc + "-" + TfvcBaseTelemetryEvents.WorkspaceAccessError;
}

export class WellKnownRepositoryTypes {
Expand Down
2 changes: 2 additions & 0 deletions src/helpers/strings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export class Strings {
static NoFeedbackSent: string = "No feedback was sent.";
static ThanksForFeedback: string = "Thanks for sending feedback!";
static LearnMore: string = "Learn more...";
static MoreDetails: string = "More details...";
static ShowMe: string = "Show Me!";
static VS2015Update3CSR: string = "Get Latest VS 2015 Update";

Expand Down Expand Up @@ -70,6 +71,7 @@ export class Strings {
static TfVersionWarning: string = "The configured version of TF does not meet the minimum version. You may run into errors or limitations with certain commands until you upgrade. Minimum version: ";
static TfNoPendingChanges: string = "There are no matching pending changes.";
static TfServerWorkspace: string = "It appears you are using a Server workspace. Currently, TFVC support is limited to Local workspaces.";
static ClcCannotAccessWorkspace: string = "It appears you are using the TEE CLC and are unable to access an existing workspace. The TFVC SCM Provider cannot be initialized. Click 'More details...' to learn more.";
static UndoChanges: string = "Undo Changes";
static NoChangesToCheckin: string = "There are no changes to check in. Changes must be added to the 'Included' section to be checked in.";
static NoChangesToUndo: string = "There are no changes to undo.";
Expand Down
9 changes: 8 additions & 1 deletion src/tfvc/commands/commandhelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import * as path from "path";

import { parseString } from "xml2js";
import { Constants } from "../../helpers/constants";
import { Constants, TfvcTelemetryEvents } from "../../helpers/constants";
import { Logger } from "../../helpers/logger";
import { Strings } from "../../helpers/strings";
import { Utils } from "../../helpers/utils";
Expand Down Expand Up @@ -80,6 +80,13 @@ export class CommandHelper {
message = Strings.TfServerWorkspace;
messageOptions = [{ title : Strings.LearnMore,
url : Constants.ServerWorkspaceUrl }];
} else if (/TF400017: The local properties table for the local workspace/i.test(result.stderr)) {
//For now, we're assuming this is an indication of a workspace the CLC doesn't know about (but exists locally)
tfvcErrorCode = TfvcErrorCodes.WorkspaceNotKnownToClc;
message = Strings.ClcCannotAccessWorkspace;
messageOptions = [{ title : Strings.MoreDetails,
url : Constants.WorkspaceNotDetectedByClcUrl,
telemetryId: TfvcTelemetryEvents.ClcCannotAccessWorkspace }];
} else if (showFirstError) {
message = result.stderr ? result.stderr : result.stdout;
}
Expand Down
1 change: 1 addition & 0 deletions src/tfvc/tfvcerror.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,5 @@ export class TfvcErrorCodes {
public static get InInvalidState(): string { return "TfvcInInvalidState"; }
public static get NoItemsMatch(): string { return "TfvcNoItemsMatch"; }
public static get UnknownError(): string { return "UnknownError"; }
public static get WorkspaceNotKnownToClc(): string { return "WorkspaceNotKnownToClc"; }
};