Skip to content

Commit b5f3488

Browse files
edgardmessiasJohnstonCode
authored andcommitted
fix: Improved commit message notification (close #545) (#598)
1 parent b82f5cf commit b5f3488

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/svnRepository.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,11 @@ export class Repository {
284284

285285
const matches = result.stdout.match(/Committed revision (.*)\./i);
286286
if (matches && matches[0]) {
287-
return matches[0];
287+
const sendedFiles = (result.stdout.match(/(Sending|Adding|Deleting)\s+/g) || []).length;
288+
289+
const filesMessage = `${sendedFiles} ${sendedFiles === 1 ? "file" : "files"} commited`;
290+
291+
return `${filesMessage}: revision ${matches[1]}.`;
288292
}
289293

290294
return result.stdout;

src/test/repository.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ suite("Repository Tests", () => {
109109
assert.equal(repository.changes.resourceStates.length, 1);
110110

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

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

0 commit comments

Comments
 (0)