Skip to content

Commit 31ea25f

Browse files
authored
refactor: Svn errors now show the repo name in the output channel (#514)
1 parent 80f88cc commit 31ea25f

File tree

3 files changed

+17
-9
lines changed

3 files changed

+17
-9
lines changed

src/model.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ import {
1818
Status
1919
} from "./common/types";
2020
import { debounce } from "./decorators";
21+
import { exists } from "./fs/exists";
22+
import { readdir } from "./fs/readdir";
23+
import { stat } from "./fs/stat";
2124
import { configuration } from "./helpers/configuration";
2225
import { RemoteRepository } from "./remoteRepository";
2326
import { Repository } from "./repository";
@@ -31,9 +34,6 @@ import {
3134
isDescendant,
3235
normalizePath
3336
} from "./util";
34-
import { exists } from "./fs/exists";
35-
import { readdir } from "./fs/readdir";
36-
import { stat } from "./fs/stat";
3737
import { matchAll } from "./util/globMatch";
3838

3939
export class Model implements IDisposable {

src/svn.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,13 +155,15 @@ export class Svn {
155155
}),
156156
new Promise<Buffer>(resolve => {
157157
const buffers: Buffer[] = [];
158-
on((process.stdout as Readable), "data", (b: Buffer) => buffers.push(b));
159-
once((process.stdout as Readable), "close", () => resolve(Buffer.concat(buffers)));
158+
on(process.stdout as Readable, "data", (b: Buffer) => buffers.push(b));
159+
once(process.stdout as Readable, "close", () =>
160+
resolve(Buffer.concat(buffers))
161+
);
160162
}),
161163
new Promise<string>(resolve => {
162164
const buffers: Buffer[] = [];
163-
on((process.stderr as Readable), "data", (b: Buffer) => buffers.push(b));
164-
once((process.stderr as Readable), "close", () =>
165+
on(process.stderr as Readable, "data", (b: Buffer) => buffers.push(b));
166+
once(process.stderr as Readable, "close", () =>
165167
resolve(Buffer.concat(buffers).toString())
166168
);
167169
})
@@ -201,7 +203,13 @@ export class Svn {
201203
const decodedStdout = iconv.decode(stdout, encoding);
202204

203205
if (options.log !== false && stderr.length > 0) {
204-
this.logOutput(`${stderr}\n`);
206+
const name = this.lastCwd.split(/[\\\/]+/).pop();
207+
const err = stderr
208+
.split("\n")
209+
.filter((line: string) => line)
210+
.map((line: string) => `[${name}]$ ${line}`)
211+
.join("\n");
212+
this.logOutput(err);
205213
}
206214

207215
if (exitCode) {

src/svnContentProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export class SvnContentProvider
110110
return await repository.patch([fsPath]);
111111
}
112112
} catch (error) {
113-
console.error(error);
113+
// Dont show error
114114
}
115115
return "";
116116
}

0 commit comments

Comments
 (0)