From 3bc92f293ba31bdb7fed0b6ced53e3990f98bf3a Mon Sep 17 00:00:00 2001 From: Nathan Faulkner Date: Sat, 18 Aug 2018 14:36:13 +0100 Subject: [PATCH] Hide unversioned changes --- README.md | 1 + package.json | 5 +++++ src/repository.ts | 11 +++++++++-- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 49c275e1..47f153ea 100644 --- a/README.md +++ b/README.md @@ -107,6 +107,7 @@ Example: |`svn.sourceControl.combineExternalIfSameServer`|Combine the svn external in the main if is from the same server.|`false`| |`svn.sourceControl.countUnversioned`|Allow to count unversioned files in status count|`true`| |`svn.sourceControl.countIgnoreOnCommit`|Allow to count ignored files to commit in status count|`false`| +|`svn.sourceControl.hideUnversioned`|Hide unversioned files in Source Control UI|`false`| |`svn.log.length`|Number of commit messages to log|`50`| |`svn.showOutput`|Show the output window when the extension starts|`false`| |`svn.conflicts.autoResolve`|Set file to status resolved after fix conflictss|`false`| diff --git a/package.json b/package.json index 7f39f597..f30e3914 100644 --- a/package.json +++ b/package.json @@ -634,6 +634,11 @@ "Allow to count ignored files to commit in status count", "default": false }, + "svn.sourceControl.hideUnversioned": { + "type": "boolean", + "description": "Hide unversioned files in Source Control UI", + "default": false + }, "svn.log.length": { "type": "number", "minimum": 1, diff --git a/src/repository.ts b/src/repository.ts index 157c86ac..54c1da27 100644 --- a/src/repository.ts +++ b/src/repository.ts @@ -428,6 +428,10 @@ export class Repository { ); }); + const hideUnversioned = configuration.get( + "sourceControl.hideUnversioned" + ); + for (const status of statusesRepository) { if (status.path === ".") { this.isIncomplete = status.status === Status.INCOMPLETE; @@ -477,11 +481,14 @@ export class Repository { /(.+?)\.(mine|working|merge-\w+\.r\d+|r\d+)$/ ); - // If file end with (mine, working, merge, etc..) and has file without extension + // If file end with (mine, working, merge, etc..), has file without extension and + // sourceControl.hideUnversioned flag is turned on. + if (hideUnversioned) { continue; } if ( matches && matches[1] && - statuses.some(s => s.path === matches[1]) + statuses.some(s => s.path === matches[1]) && + hideUnversioned ) { continue; } else {