diff --git a/src/svn.ts b/src/svn.ts index 4c59272d..9a7f833b 100644 --- a/src/svn.ts +++ b/src/svn.ts @@ -177,8 +177,9 @@ export class Svn { } if (options.log !== false) { + const argsOut = args.map(arg => (/ /.test(arg) ? `'${arg}'` : arg)); this.logOutput( - `[${this.lastCwd.split(/[\\\/]+/).pop()}]$ svn ${args.join(" ")}\n` + `[${this.lastCwd.split(/[\\\/]+/).pop()}]$ svn ${argsOut.join(" ")}\n` ); } diff --git a/src/svnRepository.ts b/src/svnRepository.ts index 297664a3..dc323f39 100644 --- a/src/svnRepository.ts +++ b/src/svnRepository.ts @@ -4,6 +4,7 @@ import { IFileStatus, parseStatusXml } from "./statusParser"; import { parseInfoXml, ISvnInfo } from "./infoParser"; import { sequentialize } from "./decorators"; import * as path from "path"; +import * as fs from "fs"; import { fixPathSeparator } from "./util"; import { configuration } from "./helpers/configuration"; import { parseSvnList } from "./listParser"; @@ -115,7 +116,14 @@ export class Repository { async commitFiles(message: string, files: string[]) { files = files.map(file => this.removeAbsolutePath(file)); - const result = await this.exec(["commit", "-m", message, ...files]); + const args = ["commit", ...files]; + + if (fs.existsSync(path.join(this.workspaceRoot, message))) { + args.push("--force-log"); + } + args.push("-m", message); + + const result = await this.exec(args); const matches = result.stdout.match(/Committed revision (.*)\./i); if (matches && matches[0]) {