Skip to content

Commit

Permalink
fix: Fixed "failed to open path" for remote (close #593)
Browse files Browse the repository at this point in the history
  • Loading branch information
edgardmessias committed Jun 4, 2019
1 parent 3b5e2bb commit a4bb49f
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/svnRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { Svn } from "./svn";
import {
fixPathSeparator,
fixPegRevision,
isDescendant,
normalizePath,
unwrap
} from "./util";
Expand Down Expand Up @@ -183,10 +184,17 @@ export class Repository {
filePath = file;
}

let target: string = this.removeAbsolutePath(filePath);
const isChild = uri.scheme === "file" && isDescendant(this.workspaceRoot, uri.fsPath);

let target: string = filePath;

if (isChild) {
target = this.removeAbsolutePath(target);
}

if (revision) {
args.push("-r", revision);
if (!["BASE", "COMMITTED", "PREV"].includes(revision.toUpperCase())) {
if (isChild && !["BASE", "COMMITTED", "PREV"].includes(revision.toUpperCase())) {
const info = await this.getInfo();
target = info.url + "/" + target.replace(/\\/g, "/");
// TODO move to SvnRI
Expand Down

0 comments on commit a4bb49f

Please sign in to comment.