Skip to content

Commit

Permalink
feat: add a config option to hide obstructed files in Source Control UI
Browse files Browse the repository at this point in the history
  • Loading branch information
toneoesa committed Jul 13, 2024
1 parent 2d3fdc1 commit 963a2d5
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,9 @@ Here are all of the extension settings with their default values. To change any
// Hide unversioned files in Source Control UI
"svn.sourceControl.hideUnversioned": null,

// Hide obstructed files in Source Control UI
"svn.sourceControl.hideObstructed": null,

// Ignore unversioned files like .gitignore, Configuring this will overlook the default ignore rule
"svn.sourceControl.ignore": [],

Expand Down
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1240,6 +1240,11 @@
"description": "Hide unversioned files in Source Control UI",
"default": false
},
"svn.sourceControl.hideObstructed": {
"type": "boolean",
"description": "Hide obstructed files in Source Control UI",
"default": false
},
"svn.sourceControl.ignore": {
"type": "array",
"description": "Ignore unversioned files like .gitignore, Configuring this will overlook the default ignore rule",
Expand Down
9 changes: 9 additions & 0 deletions src/repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,10 @@ export class Repository implements IRemoteRepository {
"sourceControl.hideUnversioned"
);

const hideObstructed = configuration.get<boolean>(
"sourceControl.hideObstructed"
);

const ignoreList = configuration.get<string[]>("sourceControl.ignore");

for (const status of statusesRepository) {
Expand Down Expand Up @@ -600,6 +604,11 @@ export class Repository implements IRemoteRepository {
continue;
}
unversioned.push(resource);
} else if (status.status === Status.OBSTRUCTED) {
if (hideObstructed) {
continue;
}
changes.push(resource);
} else if (status.changelist) {
let changelist = changelists.get(status.changelist);
if (!changelist) {
Expand Down

0 comments on commit 963a2d5

Please sign in to comment.