Skip to content

Commit c1390f9

Browse files
authored
Merge pull request #151 from edgardmessias/fix_144
Added config options to configure status count (Close #144)
2 parents ba4220f + bcb41fc commit c1390f9

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

package.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,16 @@
461461
"Allow to show in source control the list the external folders",
462462
"default": false
463463
},
464+
"svn.sourceControl.countExternal": {
465+
"type": "boolean",
466+
"description": "Allow to count external files in status count",
467+
"default": false
468+
},
469+
"svn.sourceControl.countUnversioned": {
470+
"type": "boolean",
471+
"description": "Allow to count unversioned files in status count",
472+
"default": true
473+
},
464474
"svn.log.length": {
465475
"type": "number",
466476
"minimum": 1,

src/repository.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,8 @@ export class Repository {
223223
"SVN",
224224
Uri.file(repository.workspaceRoot)
225225
);
226+
227+
this.sourceControl.count = 0;
226228
this.sourceControl.acceptInputCommand = {
227229
command: "svn.commitWithMessage",
228230
title: "commit",
@@ -452,6 +454,22 @@ export class Repository {
452454
this.external.resourceStates = [];
453455
}
454456

457+
// svnConfig.
458+
const counts = [this.changes, this.conflicts, ...this.changelists.values()];
459+
460+
if (svnConfig.get<boolean>("sourceControl.countExternal", false)) {
461+
counts.push(this.external);
462+
}
463+
464+
if (svnConfig.get<boolean>("sourceControl.countUnversioned", false)) {
465+
counts.push(this.unversioned);
466+
}
467+
468+
this.sourceControl.count = counts.reduce(
469+
(a, b) => a + b.resourceStates.length,
470+
0
471+
);
472+
455473
this._onDidChangeStatus.fire();
456474

457475
this.currentBranch = await this.repository.getCurrentBranch();

0 commit comments

Comments
 (0)