Skip to content

Commit 13a52a5

Browse files
committed
added base check for getOpenRepository
1 parent d262c66 commit 13a52a5

File tree

4 files changed

+67
-61
lines changed

4 files changed

+67
-61
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 62 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,18 @@
1717
"bugs": {
1818
"url": "https://github.com/JohnstonCode/svn-scm/issues"
1919
},
20-
"categories": ["Other", "SCM Providers"],
21-
"keywords": ["multi-root ready", "scm", "svn"],
22-
"activationEvents": ["*"],
20+
"categories": [
21+
"Other",
22+
"SCM Providers"
23+
],
24+
"keywords": [
25+
"multi-root ready",
26+
"scm",
27+
"svn"
28+
],
29+
"activationEvents": [
30+
"*"
31+
],
2332
"main": "./out/extension",
2433
"scripts": {
2534
"vscode:prepublish": "tsc -p ./",
@@ -228,8 +237,7 @@
228237
},
229238
{
230239
"command": "svn.revertSelectedRanges",
231-
"when":
232-
"config.svn.enabled && svnOpenRepositoryCount != 0 && svnHasSupportToRegisterDiffCommand == 1"
240+
"when": "config.svn.enabled && svnOpenRepositoryCount != 0 && svnHasSupportToRegisterDiffCommand == 1"
233241
}
234242
],
235243
"scm/title": [
@@ -268,80 +276,67 @@
268276
"scm/resourceState/context": [
269277
{
270278
"command": "svn.add",
271-
"when":
272-
"config.svn.enabled && scmProvider == svn && scmResourceGroup == unversioned",
279+
"when": "config.svn.enabled && scmProvider == svn && scmResourceGroup == unversioned",
273280
"group": "inline"
274281
},
275282
{
276283
"command": "svn.add",
277-
"when":
278-
"config.svn.enabled && scmProvider == svn && scmResourceGroup == unversioned",
284+
"when": "config.svn.enabled && scmProvider == svn && scmResourceGroup == unversioned",
279285
"group": "1_modification"
280286
},
281287
{
282288
"command": "svn.openFile",
283-
"when":
284-
"config.svn.enabled && scmProvider == svn && scmResourceGroup != external",
289+
"when": "config.svn.enabled && scmProvider == svn && scmResourceGroup != external",
285290
"group": "navigation"
286291
},
287292
{
288293
"command": "svn.openHEADFile",
289-
"when":
290-
"config.svn.enabled && scmProvider == svn && scmResourceGroup != unversioned && scmResourceGroup != external",
294+
"when": "config.svn.enabled && scmProvider == svn && scmResourceGroup != unversioned && scmResourceGroup != external",
291295
"group": "navigation"
292296
},
293297
{
294298
"command": "svn.openChangeBase",
295-
"when":
296-
"config.svn.enabled && scmProvider == svn && scmResourceGroup != unversioned && scmResourceGroup != external",
299+
"when": "config.svn.enabled && scmProvider == svn && scmResourceGroup != unversioned && scmResourceGroup != external",
297300
"group": "navigation"
298301
},
299302
{
300303
"command": "svn.openChangeHead",
301-
"when":
302-
"config.svn.enabled && scmProvider == svn && scmResourceGroup != unversioned && scmResourceGroup != external",
304+
"when": "config.svn.enabled && scmProvider == svn && scmResourceGroup != unversioned && scmResourceGroup != external",
303305
"group": "navigation"
304306
},
305307
{
306308
"command": "svn.addChangelist",
307-
"when":
308-
"config.svn.enabled && scmProvider == svn && scmResourceGroup != unversioned && scmResourceGroup != external",
309+
"when": "config.svn.enabled && scmProvider == svn && scmResourceGroup != unversioned && scmResourceGroup != external",
309310
"group": "inline"
310311
},
311312
{
312313
"command": "svn.addChangelist",
313-
"when":
314-
"config.svn.enabled && scmProvider == svn && scmResourceGroup != unversioned && scmResourceGroup != external",
314+
"when": "config.svn.enabled && scmProvider == svn && scmResourceGroup != unversioned && scmResourceGroup != external",
315315
"group": "1_modification"
316316
},
317317
{
318318
"command": "svn.removeChangelist",
319-
"when":
320-
"config.svn.enabled && scmProvider == svn && scmResourceGroup != changes && scmResourceGroup != unversioned && scmResourceGroup != external",
319+
"when": "config.svn.enabled && scmProvider == svn && scmResourceGroup != changes && scmResourceGroup != unversioned && scmResourceGroup != external",
321320
"group": "inline"
322321
},
323322
{
324323
"command": "svn.removeChangelist",
325-
"when":
326-
"config.svn.enabled && scmProvider == svn && scmResourceGroup != changes && scmResourceGroup != unversioned && scmResourceGroup != external",
324+
"when": "config.svn.enabled && scmProvider == svn && scmResourceGroup != changes && scmResourceGroup != unversioned && scmResourceGroup != external",
327325
"group": "1_modification"
328326
},
329327
{
330328
"command": "svn.commit",
331-
"when":
332-
"scmProvider == svn && scmResourceGroup != unversioned && scmResourceGroup != external",
329+
"when": "scmProvider == svn && scmResourceGroup != unversioned && scmResourceGroup != external",
333330
"group": "1_modification"
334331
},
335332
{
336333
"command": "svn.revert",
337-
"when":
338-
"scmProvider == svn && scmResourceGroup != unversioned && scmResourceGroup != external",
334+
"when": "scmProvider == svn && scmResourceGroup != unversioned && scmResourceGroup != external",
339335
"group": "1_modification"
340336
},
341337
{
342338
"command": "svn.remove",
343-
"when":
344-
"scmProvider == svn && scmResourceGroup != unversioned && scmResourceGroup != external",
339+
"when": "scmProvider == svn && scmResourceGroup != unversioned && scmResourceGroup != external",
345340
"group": "2_modification"
346341
}
347342
],
@@ -355,26 +350,22 @@
355350
{
356351
"command": "svn.openFile",
357352
"group": "navigation",
358-
"when":
359-
"config.svn.enabled && svnOpenRepositoryCount != 0 && isInDiffEditor && resourceScheme != extension && resourceScheme != merge-conflict.conflict-diff"
353+
"when": "config.svn.enabled && svnOpenRepositoryCount != 0 && isInDiffEditor && resourceScheme != extension && resourceScheme != merge-conflict.conflict-diff"
360354
},
361355
{
362356
"command": "svn.openChangeBase",
363357
"group": "navigation",
364-
"when":
365-
"config.svn.enabled && svnOpenRepositoryCount != 0 && !isInDiffEditor && resourceScheme == file"
358+
"when": "config.svn.enabled && svnOpenRepositoryCount != 0 && !isInDiffEditor && resourceScheme == file"
366359
},
367360
{
368361
"command": "svn.openChangeHead",
369362
"group": "navigation",
370-
"when":
371-
"config.svn.enabled && svnOpenRepositoryCount != 0 && !isInDiffEditor && resourceScheme == file"
363+
"when": "config.svn.enabled && svnOpenRepositoryCount != 0 && !isInDiffEditor && resourceScheme == file"
372364
},
373365
{
374366
"command": "svn.revertSelectedRanges",
375367
"group": "2_svn@3",
376-
"when":
377-
"config.svn.enabled && svnOpenRepositoryCount != 0 && isInDiffEditor && resourceScheme != merge-conflict.conflict-diff && && svnHasSupportToRegisterDiffCommand == 1"
368+
"when": "config.svn.enabled && svnOpenRepositoryCount != 0 && isInDiffEditor && resourceScheme != merge-conflict.conflict-diff && && svnHasSupportToRegisterDiffCommand == 1"
378369
}
379370
]
380371
},
@@ -393,45 +384,51 @@
393384
},
394385
"svn.decorations.enabled": {
395386
"type": "boolean",
396-
"description":
397-
"Controls if SVN contributes colors and badges to the explorer and the open (VSCode >= 1.18 with proposed-api)",
387+
"description": "Controls if SVN contributes colors and badges to the explorer and the open (VSCode >= 1.18 with proposed-api)",
398388
"default": true
399389
},
400390
"svn.path": {
401-
"type": ["string", "null"],
391+
"type": [
392+
"string",
393+
"null"
394+
],
402395
"description": "Path to the svn executable",
403396
"default": null,
404397
"isExecutable": true
405398
},
406399
"svn.diff.withHead": {
407400
"type": "boolean",
408-
"description":
409-
"Show diff changes using latest revision in the repository. Set false to use latest revision in local folder",
401+
"description": "Show diff changes using latest revision in the repository. Set false to use latest revision in local folder",
410402
"default": true
411403
},
412404
"svn.layout.trunk": {
413-
"type": ["string", "null"],
414-
"description":
415-
"Relative path for 'trunk' in SVN URL, 'null' to disable. (Ex.: 'trunk', 'main')",
405+
"type": [
406+
"string",
407+
"null"
408+
],
409+
"description": "Relative path for 'trunk' in SVN URL, 'null' to disable. (Ex.: 'trunk', 'main')",
416410
"default": "trunk"
417411
},
418412
"svn.layout.branches": {
419-
"type": ["string", "null"],
420-
"description":
421-
"Relative path for 'branches' in SVN URL, 'null' to disable. (Ex.: 'branches', 'versions')",
413+
"type": [
414+
"string",
415+
"null"
416+
],
417+
"description": "Relative path for 'branches' in SVN URL, 'null' to disable. (Ex.: 'branches', 'versions')",
422418
"default": "branches"
423419
},
424420
"svn.layout.tags": {
425-
"type": ["string", "null"],
426-
"description":
427-
"Relative path for 'tags' in SVN URL, 'null' to disable. (Ex.: 'tags', 'stamps')",
421+
"type": [
422+
"string",
423+
"null"
424+
],
425+
"description": "Relative path for 'tags' in SVN URL, 'null' to disable. (Ex.: 'tags', 'stamps')",
428426
"default": "tags"
429427
},
430428
"svn.branch.update": {
431429
"type": "number",
432430
"minimum": 0,
433-
"description":
434-
"How frequently (in minutes) to check branch changes. Set to `0` to avoid periodic checks.",
431+
"description": "How frequently (in minutes) to check branch changes. Set to `0` to avoid periodic checks.",
435432
"default": 5
436433
},
437434
"svn.multipleFolders.enabled": {
@@ -448,17 +445,23 @@
448445
"svn.multipleFolders.ignore": {
449446
"type": "array",
450447
"description": "Folders to ignore using SVN",
451-
"default": ["**/.git", "**/.hg", "**/vendor", "**/node_modules"]
448+
"default": [
449+
"**/.git",
450+
"**/.hg",
451+
"**/vendor",
452+
"**/node_modules"
453+
]
452454
},
453455
"svn.sourceControl.ignoreOnCommit": {
454456
"type": "array",
455457
"description": "Changelists to ignore on commit",
456-
"default": ["ignore-on-commit"]
458+
"default": [
459+
"ignore-on-commit"
460+
]
457461
},
458462
"svn.sourceControl.showExternal": {
459463
"type": "boolean",
460-
"description":
461-
"Allow to show in source control the list the external folders",
464+
"description": "Allow to show in source control the list the external folders",
462465
"default": false
463466
},
464467
"svn.sourceControl.countExternal": {

src/model.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,10 @@ export class Model implements IDisposable {
257257

258258
if (hint instanceof Uri) {
259259
for (const liveRepository of this.openRepositories) {
260+
if (liveRepository.repository.workspaceRoot.split(path.sep)[0] !== hint.fsPath.split(path.sep)[0]) {
261+
return undefined;
262+
}
263+
260264
const relativePath = path.relative(
261265
liveRepository.repository.workspaceRoot,
262266
hint.fsPath

src/repository.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ class OperationsImpl implements Operations {
112112
}
113113

114114
export class Repository {
115-
public watcher: FileSystemWatcher;
116115
public sourceControl: SourceControl;
117116
public statusBar: SvnStatusBar;
118117
public changes: SvnResourceGroup;

0 commit comments

Comments
 (0)