diff --git a/README.md b/README.md index 6d619d41..2bfe891a 100644 --- a/README.md +++ b/README.md @@ -105,6 +105,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 56024cdf..752933c1 100644 --- a/package.json +++ b/package.json @@ -649,6 +649,11 @@ "description": "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 3b3eaff0..6d700554 100644 --- a/src/repository.ts +++ b/src/repository.ts @@ -372,6 +372,10 @@ export class Repository { ); }); + const hideUnversioned = configuration.get( + "sourceControl.hideUnversioned" + ); + for (const status of statusesRepository) { if (status.path === ".") { this.isIncomplete = status.status === Status.INCOMPLETE; @@ -439,11 +443,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 {