Browse Source

Renames parameters

main
Eric Amodio 3 years ago
parent
commit
147582b188
10 changed files with 23 additions and 23 deletions
  1. +2
    -2
      src/commands/openComparisonOnRemote.ts
  2. +1
    -1
      src/commands/openOnRemote.ts
  3. +2
    -2
      src/git/remotes/azure-devops.ts
  4. +2
    -2
      src/git/remotes/bitbucket-server.ts
  5. +2
    -2
      src/git/remotes/bitbucket.ts
  6. +2
    -2
      src/git/remotes/custom.ts
  7. +2
    -2
      src/git/remotes/github.ts
  8. +2
    -2
      src/git/remotes/gitlab.ts
  9. +4
    -4
      src/git/remotes/provider.ts
  10. +4
    -4
      src/quickpicks/remoteProviderPicker.ts

+ 2
- 2
src/commands/openComparisonOnRemote.ts View File

@ -46,8 +46,8 @@ export class OpenComparisonOnRemoteCommand extends Command {
void (await executeCommand<OpenOnRemoteCommandArgs>(Commands.OpenOnRemote, {
resource: {
type: RemoteResourceType.Comparison,
ref1: args.ref1,
ref2: args.ref2,
base: args.ref1,
compare: args.ref2,
notation: args.notation,
},
repoPath: args.repoPath,

+ 1
- 1
src/commands/openOnRemote.ts View File

@ -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:

+ 2
- 2
src/git/remotes/azure-devops.ts View File

@ -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 {

+ 2
- 2
src/git/remotes/bitbucket-server.ts View File

@ -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 {

+ 2
- 2
src/git/remotes/bitbucket.ts View File

@ -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 {

+ 2
- 2
src/git/remotes/custom.ts View File

@ -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 }),
);
}

+ 2
- 2
src/git/remotes/github.ts View File

@ -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 {

+ 2
- 2
src/git/remotes/gitlab.ts View File

@ -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 {

+ 4
- 4
src/git/remotes/provider.ts View File

@ -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;

+ 4
- 4
src/quickpicks/remoteProviderPicker.ts View File

@ -41,12 +41,12 @@ export class CopyOrOpenRemoteCommandQuickPickItem extends CommandQuickPickItem {
async execute(): Promise<void> {
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 &&

Loading…
Cancel
Save