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

Commit

Permalink
More refactoring to remove TFVC in method names
Browse files Browse the repository at this point in the history
  • Loading branch information
jpricket committed Feb 15, 2017
1 parent 0daa4e5 commit 41f660e
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 31 deletions.
24 changes: 12 additions & 12 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,30 +45,30 @@ export async function activate(context: ExtensionContext) {
context.subscriptions.push(commands.registerCommand(CommandNames.Reinitialize, () => _extensionManager.Reinitialize()));

// TFVC Commands
context.subscriptions.push(commands.registerCommand(TfvcCommandNames.Status, () => _extensionManager.Tfvc.TfvcStatus()));
context.subscriptions.push(commands.registerCommand(TfvcCommandNames.Status, () => _extensionManager.Tfvc.Status()));
context.subscriptions.push(commands.registerCommand(TfvcCommandNames.Undo, (...args) => {
_extensionManager.Tfvc.TfvcUndo(args ? args[0] : undefined);
_extensionManager.Tfvc.Undo(args ? args[0] : undefined);
}));
context.subscriptions.push(commands.registerCommand(TfvcCommandNames.Exclude, (...args) => {
_extensionManager.Tfvc.TfvcExclude(args ? args[0] : undefined);
_extensionManager.Tfvc.Exclude(args ? args[0] : undefined);
}));
context.subscriptions.push(commands.registerCommand(TfvcCommandNames.Include, (...args) => {
_extensionManager.Tfvc.TfvcInclude(args ? args[0] : undefined);
_extensionManager.Tfvc.Include(args ? args[0] : undefined);
}));
context.subscriptions.push(commands.registerCommand(TfvcCommandNames.OpenDiff, (...args) => {
_extensionManager.Tfvc.TfvcOpenDiff(args ? args[0] : undefined);
_extensionManager.Tfvc.OpenDiff(args ? args[0] : undefined);
}));
context.subscriptions.push(commands.registerCommand(TfvcCommandNames.OpenFile, (...args) => {
_extensionManager.Tfvc.TfvcOpenFile(args ? args[0] : undefined);
_extensionManager.Tfvc.OpenFile(args ? args[0] : undefined);
}));
context.subscriptions.push(commands.registerCommand(TfvcCommandNames.Refresh, () => _extensionManager.Tfvc.TfvcRefresh()));
context.subscriptions.push(commands.registerCommand(TfvcCommandNames.ShowOutput, () => _extensionManager.Tfvc.TfvcShowOutput()));
context.subscriptions.push(commands.registerCommand(TfvcCommandNames.Refresh, () => _extensionManager.Tfvc.Refresh()));
context.subscriptions.push(commands.registerCommand(TfvcCommandNames.ShowOutput, () => _extensionManager.Tfvc.ShowOutput()));
context.subscriptions.push(commands.registerCommand(TfvcCommandNames.ResolveKeepYours, (...args) => {
_extensionManager.Tfvc.TfvcResolve(args ? args[0] : undefined, AutoResolveType.KeepYours);
_extensionManager.Tfvc.Resolve(args ? args[0] : undefined, AutoResolveType.KeepYours);
}));
context.subscriptions.push(commands.registerCommand(TfvcCommandNames.ResolveTakeTheirs, (...args) => {
_extensionManager.Tfvc.TfvcResolve(args ? args[0] : undefined, AutoResolveType.TakeTheirs);
_extensionManager.Tfvc.Resolve(args ? args[0] : undefined, AutoResolveType.TakeTheirs);
}));
context.subscriptions.push(commands.registerCommand(TfvcCommandNames.Checkin, () => _extensionManager.Tfvc.TfvcCheckin()));
context.subscriptions.push(commands.registerCommand(TfvcCommandNames.Sync, () => _extensionManager.Tfvc.TfvcSync()));
context.subscriptions.push(commands.registerCommand(TfvcCommandNames.Checkin, () => _extensionManager.Tfvc.Checkin()));
context.subscriptions.push(commands.registerCommand(TfvcCommandNames.Sync, () => _extensionManager.Tfvc.Sync()));
}
2 changes: 1 addition & 1 deletion src/team-extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export class TeamExtension {
if (this._manager.RepoContext.Type === RepositoryType.GIT && this._gitClient) {
this._gitClient.OpenFileHistory(this._manager.RepoContext);
} else if (this._manager.RepoContext.Type === RepositoryType.TFVC) {
this._manager.Tfvc.TfvcViewHistory();
this._manager.Tfvc.ViewHistory();
} else {
this._manager.DisplayErrorMessage(Strings.NoRepoInformation);
}
Expand Down
12 changes: 6 additions & 6 deletions src/tfvc/repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,18 @@ export class Repository {
return this._repositoryRootFolder;
}

public async Checkin(files: string[], comment: string, workItemIds: number[]): Promise<string> {
Logger.LogDebug(`TFVC Repository.Checkin`);
return this.RunCommand<string>(
new Checkin(this._serverContext, files, comment, workItemIds));
}

public async Add(itemPaths: string[]): Promise<string[]> {
Logger.LogDebug(`TFVC Repository.Add`);
return this.RunCommand<string[]>(
new Add(this._serverContext, itemPaths));
}

public async Checkin(files: string[], comment: string, workItemIds: number[]): Promise<string> {
Logger.LogDebug(`TFVC Repository.Checkin`);
return this.RunCommand<string>(
new Checkin(this._serverContext, files, comment, workItemIds));
}

public async FindConflicts(itemPath?: string): Promise<IConflict[]> {
Logger.LogDebug(`TFVC Repository.FindConflicts`);
return this.RunCommand<IConflict[]>(
Expand Down
24 changes: 12 additions & 12 deletions src/tfvc/tfvc-extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class TfvcExtension {
this._manager = manager;
}

public async TfvcCheckin(): Promise<void> {
public async Checkin(): Promise<void> {
this.displayErrors(async () => {
// get the checkin info from the SCM viewlet
const checkinInfo: ICheckinInfo = TfvcSCMProvider.GetCheckinInfo();
Expand All @@ -49,7 +49,7 @@ export class TfvcExtension {
});
}

public async TfvcExclude(uri?: Uri): Promise<void> {
public async Exclude(uri?: Uri): Promise<void> {
this.displayErrors(async () => {
if (uri) {
//Keep an in-memory list of items that were explicitly excluded. The list is not persisted at this time.
Expand All @@ -58,7 +58,7 @@ export class TfvcExtension {
});
}

public async TfvcInclude(uri?: Uri): Promise<void> {
public async Include(uri?: Uri): Promise<void> {
this.displayErrors(async () => {
if (uri) {
let resource: Resource = TfvcSCMProvider.ResolveTfvcResource(uri);
Expand All @@ -77,7 +77,7 @@ export class TfvcExtension {
});
}

public async TfvcOpenDiff(uri?: Uri): Promise<void> {
public async OpenDiff(uri?: Uri): Promise<void> {
this.displayErrors(async () => {
if (uri) {
let resource: Resource = TfvcSCMProvider.ResolveTfvcResource(uri);
Expand All @@ -86,7 +86,7 @@ export class TfvcExtension {
});
}

public async TfvcOpenFile(uri?: Uri): Promise<void> {
public async OpenFile(uri?: Uri): Promise<void> {
this.displayErrors(async () => {
if (uri) {
let path: string = TfvcSCMProvider.GetPathFromUri(uri);
Expand All @@ -95,13 +95,13 @@ export class TfvcExtension {
});
}

public async TfvcRefresh(): Promise<void> {
public async Refresh(): Promise<void> {
this.displayErrors(async () => {
TfvcSCMProvider.Refresh();
});
}

public async TfvcResolve(uri: Uri, autoResolveType: AutoResolveType): Promise<void> {
public async Resolve(uri: Uri, autoResolveType: AutoResolveType): Promise<void> {
this.displayErrors(async () => {
if (uri) {
let localPath: string = TfvcSCMProvider.GetPathFromUri(uri);
Expand All @@ -118,7 +118,7 @@ export class TfvcExtension {
});
}

public async TfvcShowOutput(): Promise<void> {
public async ShowOutput(): Promise<void> {
TfvcOutput.Show();
}

Expand All @@ -127,7 +127,7 @@ export class TfvcExtension {
* displays the results to the user. Selecting one of the files in the list will
* open the file in the editor.
*/
public async TfvcStatus(): Promise<void> {
public async Status(): Promise<void> {
this.displayErrors(async () => {
Telemetry.SendEvent(TfvcTelemetryEvents.Status);
const chosenItem: IPendingChange = await UIHelper.ChoosePendingChange(await this._repo.GetStatus());
Expand All @@ -141,7 +141,7 @@ export class TfvcExtension {
* This command runs a 'tf get' command on the VSCode workspace folder and
* displays the results to the user.
*/
public async TfvcSync(): Promise<void> {
public async Sync(): Promise<void> {
this.displayErrors(async () => {
Telemetry.SendEvent(TfvcTelemetryEvents.Sync);
const results: ISyncResults = await this._repo.Sync([this._repo.Path], true);
Expand All @@ -154,7 +154,7 @@ export class TfvcExtension {
* editor. If the undo command applies to the file, the pending changes will be undone. The
* file system watcher will update the UI soon thereafter. No results are displayed to the user.
*/
public async TfvcUndo(uri?: Uri): Promise<void> {
public async Undo(uri?: Uri): Promise<void> {
this.displayErrors(async () => {
//When calling from UI, we have the uri of the resource from which the command was invoked
let pathToUndo: string = TfvcSCMProvider.GetPathFromUri(uri);
Expand All @@ -179,7 +179,7 @@ export class TfvcExtension {
* This command runs the info command on the passed in itemPath and
* opens a web browser to the appropriate history page.
*/
public async TfvcViewHistory(): Promise<void> {
public async ViewHistory(): Promise<void> {
if (!this._manager.EnsureInitialized(RepositoryType.TFVC)) {
this._manager.DisplayErrorMessage();
return;
Expand Down

0 comments on commit 41f660e

Please sign in to comment.