From 1ea1b26e14cdfeea941ece35004aa659c80c9a2e Mon Sep 17 00:00:00 2001 From: Azuo Lee Date: Tue, 20 Jun 2023 02:54:59 +0800 Subject: [PATCH] fix: Use path.posix to handle uri related paths (#1598) --- src/commands/log.ts | 2 +- src/commands/openHeadFile.ts | 6 +++--- src/commands/search_log_by_revision.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/commands/log.ts b/src/commands/log.ts index 540e9f8fb..6b4b4650a 100644 --- a/src/commands/log.ts +++ b/src/commands/log.ts @@ -1,4 +1,4 @@ -import * as path from "path"; +import { posix as path } from "path"; import { commands, Uri, window } from "vscode"; import { SvnUriAction } from "../common/types"; import { Repository } from "../repository"; diff --git a/src/commands/openHeadFile.ts b/src/commands/openHeadFile.ts index 9f5d4b976..456acb151 100644 --- a/src/commands/openHeadFile.ts +++ b/src/commands/openHeadFile.ts @@ -1,4 +1,4 @@ -import * as path from "path"; +import { posix as path } from "path"; import { commands, Uri, window } from "vscode"; import { Resource } from "../resource"; import IncomingChangeNode from "../treeView/nodes/incomingChangeNode"; @@ -28,7 +28,7 @@ export class OpenHeadFile extends Command { const HEAD = await this.getLeftResource(resource, "HEAD"); - const basename = path.basename(resource.resourceUri.fsPath); + const basename = path.basename(resource.resourceUri.path); if (!HEAD) { window.showWarningMessage( `"HEAD version of '${basename}' is not available."` @@ -36,7 +36,7 @@ export class OpenHeadFile extends Command { return; } - const basedir = path.dirname(resource.resourceUri.fsPath); + const basedir = path.dirname(resource.resourceUri.path); const uri = HEAD.with({ path: path.join(basedir, `(HEAD) ${basename}`) // change document title diff --git a/src/commands/search_log_by_revision.ts b/src/commands/search_log_by_revision.ts index fddd32448..e59b928c9 100644 --- a/src/commands/search_log_by_revision.ts +++ b/src/commands/search_log_by_revision.ts @@ -1,4 +1,4 @@ -import * as path from "path"; +import { posix as path } from "path"; import { Command } from "./command"; import { window, Uri, commands } from "vscode"; import { Repository } from "../repository";