Ver a proveniência

Reverses deeplink comparision ordering

main
Eric Amodio há 1 ano
ascendente
cometimento
fd5d57f285
2 ficheiros alterados com 18 adições e 11 eliminações
  1. +1
    -0
      CHANGELOG.md
  2. +17
    -11
      src/uris/deepLinks/deepLinkService.ts

+ 1
- 0
CHANGELOG.md Ver ficheiro

@ -17,6 +17,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
### Fixed
- Fixes [#2744](https://github.com/gitkraken/vscode-gitlens/issues/2744) - GH enterprise access with focus view
- Fixes deeplink comparison ordering for a better experience
## [14.1.0] - 2023-07-13

+ 17
- 11
src/uris/deepLinks/deepLinkService.ts Ver ficheiro

@ -4,7 +4,7 @@ import { Commands } from '../../constants';
import type { Container } from '../../container';
import { getBranchNameWithoutRemote } from '../../git/models/branch';
import type { GitReference } from '../../git/models/reference';
import { createReference } from '../../git/models/reference';
import { createReference, isSha } from '../../git/models/reference';
import type { GitRemote } from '../../git/models/remote';
import { parseGitRemoteUrl } from '../../git/parsers/remoteParser';
import type { ShowInCommitGraphCommandArgs } from '../../plus/webviews/graph/protocol';
@ -669,7 +669,13 @@ export class DeepLinkService implements Disposable {
break;
}
await this.container.searchAndCompareView.compare(repo.path, targetSha, secondaryTargetSha);
await this.container.searchAndCompareView.compare(
repo.path,
isSha(secondaryTargetSha)
? secondaryTargetSha
: { label: secondaryTargetSha, ref: secondaryTargetSha },
isSha(targetSha) ? targetSha : { label: targetSha, ref: targetSha },
);
action = DeepLinkServiceAction.DeepLinkResolved;
break;
@ -686,16 +692,16 @@ export class DeepLinkService implements Disposable {
repoPath: string,
remoteUrl: string,
compareRef?: string,
compareToRef?: string,
compareWithRef?: string,
): Promise<void>;
async copyDeepLinkUrl(
refOrRepoPath: string | GitReference,
remoteUrl: string,
compareRef?: string,
compareToRef?: string,
compareWithRef?: string,
): Promise<void> {
const url = await (typeof refOrRepoPath === 'string'
? this.generateDeepLinkUrl(refOrRepoPath, remoteUrl, compareRef, compareToRef)
? this.generateDeepLinkUrl(refOrRepoPath, remoteUrl, compareRef, compareWithRef)
: this.generateDeepLinkUrl(refOrRepoPath, remoteUrl));
await env.clipboard.writeText(url.toString());
}
@ -705,13 +711,13 @@ export class DeepLinkService implements Disposable {
repoPath: string,
remoteUrl: string,
compareRef?: string,
compareToRef?: string,
compareWithRef?: string,
): Promise<URL>;
async generateDeepLinkUrl(
refOrRepoPath: string | GitReference,
remoteUrl: string,
compareRef?: string,
compareToRef?: string,
compareWithRef?: string,
): Promise<URL> {
const repoPath = typeof refOrRepoPath !== 'string' ? refOrRepoPath.repoPath : refOrRepoPath;
let repoId;
@ -723,7 +729,7 @@ export class DeepLinkService implements Disposable {
let targetType: DeepLinkType | undefined;
let targetId: string | undefined;
let compareTargetId: string | undefined;
let compareWithTargetId: string | undefined;
if (typeof refOrRepoPath !== 'string') {
switch (refOrRepoPath.refType) {
case 'branch':
@ -743,17 +749,17 @@ export class DeepLinkService implements Disposable {
}
}
if (compareRef != null && compareToRef != null) {
if (compareRef != null && compareWithRef != null) {
targetType = DeepLinkType.Comparison;
targetId = compareRef;
compareTargetId = compareToRef;
compareWithTargetId = compareWithRef;
}
const schemeOverride = configuration.get('deepLinks.schemeOverride');
const scheme = !schemeOverride ? 'vscode' : schemeOverride === true ? env.uriScheme : schemeOverride;
let target;
if (targetType === DeepLinkType.Comparison) {
target = `/${targetType}/${targetId}...${compareTargetId}`;
target = `/${targetType}/${compareWithTargetId}...${targetId}`;
} else if (targetType != null && targetType !== DeepLinkType.Repository) {
target = `/${targetType}/${targetId}`;
} else {

Carregando…
Cancelar
Guardar