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

Several changes #78

Merged
merged 4 commits into from
Jan 31, 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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
},
{
"command": "tfvc.Status",
"title": "tfvc status"
"title": "TFVC: Status"
}
]
},
Expand Down
2 changes: 2 additions & 0 deletions src/helpers/strings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,11 @@ export class Strings {

// TFVC messages/errors
static ChooseItemQuickPickPlaceHolder: string = "Choose a file to open it.";
static NotATfvcRepository: string = "The open folder is not a TFVC repository. Please check the folder location and try again.";
static TfvcLocationMissingError: string = "The path to the TFVC command line was not found in the user settings. Please set this value (tfvc.location) and try again.";
static TfMissingError: string = "Unable to find the TF executable at the expected location. Please verify the installation and location of TF. Expected path: ";
static TfExecFailedError: string = "Execution of the TFVC command line failed unexpectedly.";
static TfVersionWarning: string = "The installed version of the TF command line does not meet the minimum suggested version. You may run into errors or limitations with certain commands until you upgrade. Minimum suggested version: ";
static TfNoPendingChanges: string = "There are no matching pending changes.";
}
/* tslint:enable:variable-name */
6 changes: 5 additions & 1 deletion src/tfvc/tfvc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ export class Tfvc {

if (result.exitCode) {
let tfvcErrorCode: string = null;
let message: string;

if (/Authentication failed/.test(result.stderr)) {
tfvcErrorCode = TfvcErrorCodes.AuthenticationFailed;
Expand All @@ -131,14 +132,17 @@ export class Tfvc {
tfvcErrorCode = TfvcErrorCodes.RepositoryNotFound;
} else if (/unable to access/.test(result.stderr)) {
tfvcErrorCode = TfvcErrorCodes.CantAccessRemote;
} else if (/project collection URL to use could not be determined/i.test(result.stderr)) {
tfvcErrorCode = TfvcErrorCodes.NotATfvcRepository;
message = Strings.NotATfvcRepository;
}

if (options.log !== false) {
this.log(`${result.stderr}\n`);
}

return Promise.reject<IExecutionResult>(new TfvcError({
message: Strings.TfExecFailedError,
message: message || Strings.TfExecFailedError,
stdout: result.stdout,
stderr: result.stderr,
exitCode: result.exitCode,
Expand Down
8 changes: 8 additions & 0 deletions src/tfvc/uihelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ export class UIHelper {
}
}
}
} else if (changes && changes.length === 0) {
let items: QuickPickItem[] = [];
items.push({
label: Strings.TfNoPendingChanges,
description: undefined,
detail: undefined
});
await window.showQuickPick(items);
}
return undefined;
}
Expand Down