Skip to content

Commit

Permalink
fix: Improved commit message notification (close #545) (#598)
Browse files Browse the repository at this point in the history
  • Loading branch information
edgardmessias authored and JohnstonCode committed Jun 3, 2019
1 parent b82f5cf commit b5f3488
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/svnRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,11 @@ export class Repository {

const matches = result.stdout.match(/Committed revision (.*)\./i);
if (matches && matches[0]) {
return matches[0];
const sendedFiles = (result.stdout.match(/(Sending|Adding|Deleting)\s+/g) || []).length;

const filesMessage = `${sendedFiles} ${sendedFiles === 1 ? "file" : "files"} commited`;

return `${filesMessage}: revision ${matches[1]}.`;
}

return result.stdout;
Expand Down
2 changes: 1 addition & 1 deletion src/test/repository.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ suite("Repository Tests", () => {
assert.equal(repository.changes.resourceStates.length, 1);

const message = await repository.commitFiles("First Commit", [file]);
assert.ok(/Committed revision (.*)\./i.test(message));
assert.ok(/1 file commited: revision (.*)\./i.test(message));

assert.equal(repository.changes.resourceStates.length, 0);

Expand Down

0 comments on commit b5f3488

Please sign in to comment.