From 147582b18881e117efd4c3c0ee53535741eeb7ff Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Sun, 28 Feb 2021 00:33:46 -0500 Subject: [PATCH] Renames parameters --- src/commands/openComparisonOnRemote.ts | 4 ++-- src/commands/openOnRemote.ts | 2 +- src/git/remotes/azure-devops.ts | 4 ++-- src/git/remotes/bitbucket-server.ts | 4 ++-- src/git/remotes/bitbucket.ts | 4 ++-- src/git/remotes/custom.ts | 4 ++-- src/git/remotes/github.ts | 4 ++-- src/git/remotes/gitlab.ts | 4 ++-- src/git/remotes/provider.ts | 8 ++++---- src/quickpicks/remoteProviderPicker.ts | 8 ++++---- 10 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/commands/openComparisonOnRemote.ts b/src/commands/openComparisonOnRemote.ts index 6ae4d54..2522a95 100644 --- a/src/commands/openComparisonOnRemote.ts +++ b/src/commands/openComparisonOnRemote.ts @@ -46,8 +46,8 @@ export class OpenComparisonOnRemoteCommand extends Command { void (await executeCommand(Commands.OpenOnRemote, { resource: { type: RemoteResourceType.Comparison, - ref1: args.ref1, - ref2: args.ref2, + base: args.ref1, + compare: args.ref2, notation: args.notation, }, repoPath: args.repoPath, diff --git a/src/commands/openOnRemote.ts b/src/commands/openOnRemote.ts index 8073d35..e2d540e 100644 --- a/src/commands/openOnRemote.ts +++ b/src/commands/openOnRemote.ts @@ -107,7 +107,7 @@ export class OpenOnRemoteCommand extends Command { GlyphChars.Dot, 2, 2, - )}${GitRevision.createRange(args.resource.ref1, args.resource.ref2, '...')}`; + )}${GitRevision.createRange(args.resource.base, args.resource.compare, '...')}`; break; case RemoteResourceType.File: diff --git a/src/git/remotes/azure-devops.ts b/src/git/remotes/azure-devops.ts index bcc9c1f..ecbd1fd 100644 --- a/src/git/remotes/azure-devops.ts +++ b/src/git/remotes/azure-devops.ts @@ -124,8 +124,8 @@ export class AzureDevOpsRemote extends RemoteProvider { return `${this.baseUrl}/commit/${sha}`; } - protected getUrlForComparison(ref1: string, ref2: string, _notation: '..' | '...'): string { - return `${this.baseUrl}/branchCompare?baseVersion=GB${ref1}&targetVersion=GB${ref2}`; + protected getUrlForComparison(base: string, compare: string, _notation: '..' | '...'): string { + return `${this.baseUrl}/branchCompare?baseVersion=GB${base}&targetVersion=GB${compare}`; } protected getUrlForFile(fileName: string, branch?: string, sha?: string, range?: Range): string { diff --git a/src/git/remotes/bitbucket-server.ts b/src/git/remotes/bitbucket-server.ts index f2c0949..d113fe3 100644 --- a/src/git/remotes/bitbucket-server.ts +++ b/src/git/remotes/bitbucket-server.ts @@ -126,8 +126,8 @@ export class BitbucketServerRemote extends RemoteProvider { return `${this.baseUrl}/commits/${sha}`; } - protected getUrlForComparison(ref1: string, ref2: string, _notation: '..' | '...'): string { - return `${this.baseUrl}/branches/compare/${ref1}%0D${ref2}`; + protected getUrlForComparison(base: string, compare: string, _notation: '..' | '...'): string { + return `${this.baseUrl}/branches/compare/${base}%0D${compare}`; } protected getUrlForFile(fileName: string, branch?: string, sha?: string, range?: Range): string { diff --git a/src/git/remotes/bitbucket.ts b/src/git/remotes/bitbucket.ts index 1d3346c..a6f7fcd 100644 --- a/src/git/remotes/bitbucket.ts +++ b/src/git/remotes/bitbucket.ts @@ -119,8 +119,8 @@ export class BitbucketRemote extends RemoteProvider { return `${this.baseUrl}/commits/${sha}`; } - protected getUrlForComparison(ref1: string, ref2: string, _notation: '..' | '...'): string { - return `${this.baseUrl}/branches/compare/${ref1}%0D${ref2}`; + protected getUrlForComparison(base: string, compare: string, _notation: '..' | '...'): string { + return `${this.baseUrl}/branches/compare/${base}%0D${compare}`; } protected getUrlForFile(fileName: string, branch?: string, sha?: string, range?: Range): string { diff --git a/src/git/remotes/custom.ts b/src/git/remotes/custom.ts index 5ded78e..92f1b7e 100644 --- a/src/git/remotes/custom.ts +++ b/src/git/remotes/custom.ts @@ -44,12 +44,12 @@ export class CustomRemote extends RemoteProvider { return Strings.interpolate(this.urls.commit, this.getContext({ id: sha })); } - protected getUrlForComparison(ref1: string, ref2: string, notation: '..' | '...'): string | undefined { + protected getUrlForComparison(base: string, compare: string, notation: '..' | '...'): string | undefined { if (this.urls.comparison == null) return undefined; return Strings.interpolate( this.urls.comparison, - this.getContext({ ref1: ref1, ref2: ref2, notation: notation }), + this.getContext({ ref1: base, ref2: compare, notation: notation }), ); } diff --git a/src/git/remotes/github.ts b/src/git/remotes/github.ts index d338404..ecfb3f0 100644 --- a/src/git/remotes/github.ts +++ b/src/git/remotes/github.ts @@ -139,8 +139,8 @@ export class GitHubRemote extends RichRemoteProvider { return `${this.baseUrl}/commit/${sha}`; } - protected getUrlForComparison(ref1: string, ref2: string, notation: '..' | '...'): string { - return `${this.baseUrl}/compare/${ref1}${notation}${ref2}`; + protected getUrlForComparison(base: string, compare: string, notation: '..' | '...'): string { + return `${this.baseUrl}/compare/${base}${notation}${compare}`; } protected getUrlForFile(fileName: string, branch?: string, sha?: string, range?: Range): string { diff --git a/src/git/remotes/gitlab.ts b/src/git/remotes/gitlab.ts index 8237311..852ecf7 100644 --- a/src/git/remotes/gitlab.ts +++ b/src/git/remotes/gitlab.ts @@ -114,8 +114,8 @@ export class GitLabRemote extends RemoteProvider { return `${this.baseUrl}/commit/${sha}`; } - protected getUrlForComparison(ref1: string, ref2: string, notation: '..' | '...'): string { - return `${this.baseUrl}/-/compare/${ref1}${notation}${ref2}`; + protected getUrlForComparison(base: string, compare: string, notation: '..' | '...'): string { + return `${this.baseUrl}/-/compare/${base}${notation}${compare}`; } protected getUrlForFile(fileName: string, branch?: string, sha?: string, range?: Range): string { diff --git a/src/git/remotes/provider.ts b/src/git/remotes/provider.ts index 1a9e7f3..9ab729b 100644 --- a/src/git/remotes/provider.ts +++ b/src/git/remotes/provider.ts @@ -49,8 +49,8 @@ export type RemoteResource = } | { type: RemoteResourceType.Comparison; - ref1: string; - ref2: string; + base: string; + compare: string; notation?: '..' | '...'; } | { @@ -151,7 +151,7 @@ export abstract class RemoteProvider implements RemoteProviderReference { case RemoteResourceType.Commit: return encodeURI(this.getUrlForCommit(resource.sha)); case RemoteResourceType.Comparison: { - const url = this.getUrlForComparison?.(resource.ref1, resource.ref2, resource.notation ?? '...'); + const url = this.getUrlForComparison?.(resource.base, resource.compare, resource.notation ?? '...'); return url != null ? encodeURI(url) : undefined; } case RemoteResourceType.File: @@ -199,7 +199,7 @@ export abstract class RemoteProvider implements RemoteProviderReference { protected abstract getUrlForCommit(sha: string): string; - protected getUrlForComparison?(ref1: string, ref2: string, notation: '..' | '...'): string | undefined; + protected getUrlForComparison?(base: string, compare: string, notation: '..' | '...'): string | undefined; protected abstract getUrlForFile(fileName: string, branch?: string, sha?: string, range?: Range): string; diff --git a/src/quickpicks/remoteProviderPicker.ts b/src/quickpicks/remoteProviderPicker.ts index 9412147..4f6bab5 100644 --- a/src/quickpicks/remoteProviderPicker.ts +++ b/src/quickpicks/remoteProviderPicker.ts @@ -41,12 +41,12 @@ export class CopyOrOpenRemoteCommandQuickPickItem extends CommandQuickPickItem { async execute(): Promise { let resource = this.resource; if (resource.type === RemoteResourceType.Comparison) { - if (GitBranch.getRemote(resource.ref1) === this.remote.name) { - resource = { ...resource, ref1: GitBranch.getNameWithoutRemote(resource.ref1) }; + if (GitBranch.getRemote(resource.base) === this.remote.name) { + resource = { ...resource, base: GitBranch.getNameWithoutRemote(resource.base) }; } - if (GitBranch.getRemote(resource.ref2) === this.remote.name) { - resource = { ...resource, ref2: GitBranch.getNameWithoutRemote(resource.ref2) }; + if (GitBranch.getRemote(resource.compare) === this.remote.name) { + resource = { ...resource, compare: GitBranch.getNameWithoutRemote(resource.compare) }; } } else if ( resource.type === RemoteResourceType.File &&