Skip to content

Commit 88ed080

Browse files
authored
Merge pull request #114 from edgardmessias/external_folders
Added external folder list in source control(Close #97)
2 parents cd344fa + f5f86a5 commit 88ed080

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,11 @@
200200
"minimum": 4,
201201
"description": "Folders to ignore using SVN",
202202
"default": ["**/.git", "**/.hg", "**/vendor", "**/node_modules"]
203+
},
204+
"svn.sourceControl.showExternal": {
205+
"type": "boolean",
206+
"description": "Allow to show in source control the list the external folders",
207+
"default": false
203208
}
204209
}
205210
}

src/repository.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export class Repository {
2727
public sourceControl: SourceControl;
2828
public changes: SourceControlResourceGroup;
2929
public notTracked: SourceControlResourceGroup;
30+
public external: SourceControlResourceGroup;
3031
private disposables: Disposable[] = [];
3132
public currentBranch = "";
3233
public isSwitchingBranch: boolean = false;
@@ -127,9 +128,14 @@ export class Repository {
127128
"unversioned",
128129
"Not Tracked"
129130
);
131+
this.external = this.sourceControl.createResourceGroup(
132+
"external",
133+
"External"
134+
);
130135

131136
this.changes.hideWhenEmpty = true;
132137
this.notTracked.hideWhenEmpty = true;
138+
this.external.hideWhenEmpty = true;
133139

134140
this.disposables.push(
135141
toDisposable(() => clearInterval(this.branchesTimer))
@@ -155,9 +161,11 @@ export class Repository {
155161
async update() {
156162
let changes: any[] = [];
157163
let notTracked: any[] = [];
164+
let external: any[] = [];
158165
const statuses = (await this.repository.getStatus()) || [];
159166

160167
const fileConfig = workspace.getConfiguration("files");
168+
const svnConfig = workspace.getConfiguration("svn");
161169

162170
const filesToExclude = fileConfig.get<any>("exclude", {});
163171

@@ -177,7 +185,9 @@ export class Repository {
177185
? Uri.file(path.join(this.workspaceRoot, status.rename))
178186
: undefined;
179187

180-
if (status.status === Status.UNVERSIONED) {
188+
if (status.status === Status.EXTERNAL) {
189+
external.push(new Resource(uri, status.status, renameUri));
190+
} else if (status.status === Status.UNVERSIONED) {
181191
const matches = status.path.match(
182192
/(.+?)\.(mine|working|merge-\w+\.r\d+|r\d+)$/
183193
);
@@ -200,6 +210,12 @@ export class Repository {
200210
this.changes.resourceStates = changes;
201211
this.notTracked.resourceStates = notTracked;
202212

213+
if (svnConfig.get<boolean>("sourceControl.showExternal")) {
214+
this.external.resourceStates = external;
215+
} else {
216+
this.external.resourceStates = [];
217+
}
218+
203219
this.currentBranch = await this.getCurrentBranch();
204220

205221
this._onDidChangeStatus.fire();

0 commit comments

Comments
 (0)