Skip to content

Commit c904f99

Browse files
committed
Fixes #607 - adds more uniqueness to view node ids
1 parent 7ea3489 commit c904f99

14 files changed

+33
-17
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
1212

1313
### Fixed
1414

15+
- Fixes [#606](https://github.com/eamodio/vscode-gitlens/issues/606) - ID for xxx is already registered?!
1516
- Fixes [#607](https://github.com/eamodio/vscode-gitlens/issues/607) - Open file in Remote Doesn't URL encode
1617

1718
## [9.3.0] - 2019-01-02

src/views/nodes/branchNode.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@ export class BranchNode extends ViewRefNode<RepositoriesView> implements Pageabl
3030
}
3131

3232
get id(): string {
33-
return `gitlens:repository(${this.branch.repoPath})${this._root ? ':root:' : ''}:branch(${this.branch.name})${
34-
this.branch.current ? '+current:' : ''
35-
}${this.branch.remote ? '+remote' : ''}${this.branch.starred ? '+starred:' : ''}`;
33+
return `${this._instanceId}:gitlens:repository(${this.branch.repoPath})${this._root ? ':root:' : ''}:branch(${
34+
this.branch.name
35+
})${this.branch.current ? '+current:' : ''}${this.branch.remote ? '+remote' : ''}${
36+
this.branch.starred ? '+starred:' : ''
37+
}`;
3638
}
3739

3840
get current(): boolean {

src/views/nodes/branchOrTagFolderNode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export class BranchOrTagFolderNode extends ViewNode {
2424
}
2525

2626
get id(): string {
27-
return `gitlens:repository(${this.repoPath}):${this.type}-folder(${this.relativePath})`;
27+
return `${this._instanceId}:gitlens:repository(${this.repoPath}):${this.type}-folder(${this.relativePath})`;
2828
}
2929

3030
async getChildren(): Promise<ViewNode[]> {

src/views/nodes/branchTrackingStatusNode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export class BranchTrackingStatusNode extends ViewNode<ViewWithFiles> implements
3232
}
3333

3434
get id(): string {
35-
return `gitlens:repository(${this.status.repoPath}):${this._root ? 'root:' : ''}branch(${
35+
return `${this._instanceId}:gitlens:repository(${this.status.repoPath}):${this._root ? 'root:' : ''}branch(${
3636
this.status.ref
3737
}):status:upstream:(${this.status.upstream}):${this.direction}`;
3838
}

src/views/nodes/branchesNode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export class BranchesNode extends ViewNode<RepositoriesView> {
2222
}
2323

2424
get id(): string {
25-
return `gitlens:repository(${this.repo.path}):branches`;
25+
return `${this._instanceId}:gitlens:repository(${this.repo.path}):branches`;
2626
}
2727

2828
async getChildren(): Promise<ViewNode[]> {

src/views/nodes/remoteNode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export class RemoteNode extends ViewNode<RepositoriesView> {
2222
}
2323

2424
get id(): string {
25-
return `gitlens:repository(${this.remote.repoPath}):remote(${this.remote.name})`;
25+
return `${this._instanceId}:gitlens:repository(${this.remote.repoPath}):remote(${this.remote.name})`;
2626
}
2727

2828
async getChildren(): Promise<ViewNode[]> {

src/views/nodes/remotesNode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export class RemotesNode extends ViewNode<RepositoriesView> {
1919
}
2020

2121
get id(): string {
22-
return `gitlens:repository(${this.repo.path}):remotes`;
22+
return `${this._instanceId}:gitlens:repository(${this.repo.path}):remotes`;
2323
}
2424

2525
async getChildren(): Promise<ViewNode[]> {

src/views/nodes/repositoryNode.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export class RepositoryNode extends SubscribeableViewNode<RepositoriesView> {
4141
}
4242

4343
get id(): string {
44-
return `gitlens:repository(${this.repo.path})${this.repo.starred ? '+starred:' : ''}`;
44+
return `${this._instanceId}:gitlens:repository(${this.repo.path})${this.repo.starred ? '+starred:' : ''}`;
4545
}
4646

4747
async getChildren(): Promise<ViewNode[]> {
@@ -238,9 +238,10 @@ export class RepositoryNode extends SubscribeableViewNode<RepositoriesView> {
238238
@debug({
239239
args: {
240240
0: (e: RepositoryFileSystemChangeEvent) =>
241-
`{ repository: ${e.repository ? e.repository.name : ''}, uris: [${e.uris
241+
`{ repository: ${e.repository ? e.repository.name : ''}, uris(${e.uris.length}): [${e.uris
242+
.slice(0, 1)
242243
.map(u => u.fsPath)
243-
.join(', ')}] }`
244+
.join(', ')}${e.uris.length > 1 ? ', ...' : ''}] }`
244245
}
245246
})
246247
private onFileSystemChanged(e: RepositoryFileSystemChangeEvent) {

src/views/nodes/stashNode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export class StashNode extends ViewRefNode {
1717
}
1818

1919
get id(): string {
20-
return `gitlens:repository(${this.commit.repoPath}):stash(${this.commit.sha})`;
20+
return `${this._instanceId}:gitlens:repository(${this.commit.repoPath}):stash(${this.commit.sha})`;
2121
}
2222

2323
get ref(): string {

src/views/nodes/stashesNode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export class StashesNode extends ViewNode {
1919
}
2020

2121
get id(): string {
22-
return `gitlens:repository(${this.repo.path}):stashes`;
22+
return `${this._instanceId}:gitlens:repository(${this.repo.path}):stashes`;
2323
}
2424

2525
async getChildren(): Promise<ViewNode[]> {

0 commit comments

Comments
 (0)