Skip to content

Commit 6bee184

Browse files
author
Ben Crowl
committed
Fix for #65 (thanks to KristjanTammekivi)
1 parent 8d080b3 commit 6bee184

4 files changed

Lines changed: 28 additions & 6 deletions

File tree

.vscode/settings.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,8 @@
99
"**/.DS_Store": true,
1010
"*.vsix": true,
1111
"images/production": true
12-
}
12+
},
13+
"editor.codeActionsOnSave": {
14+
"source.organizeImports": false
15+
}
1316
}

CHANGELOG.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1+
**v1.3.0**
2+
=============================================
13

4+
## Bug fix
5+
- Fixed bug caused by API change in vscode v1.31 [#65](https://github.com/mrcrowl/vscode-hg/issues/65)
26

3-
**v1.2.2**
7+
**v1.2.2-3**
48
=============================================
59

10+
## Bug fix
11+
- Fixed slow multi-file Hg operations (such as stage/add file)
12+
613
## What's New
7-
- Added "multi-root ready" keyword, as requested by VS Code Team [#29]((https://github.com/mrcrowl/vscode-hg/issues/29)
14+
- Added "multi-root ready" keyword, as requested by VS Code Team [#29](https://github.com/mrcrowl/vscode-hg/issues/29)
815

916
**v1.2.1**
1017
=============================================

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"bugs": {
1717
"url": "https://github.com/mrcrowl/vscode-hg/issues"
1818
},
19-
"version": "1.2.2",
19+
"version": "1.3.0",
2020
"engines": {
2121
"vscode": "^1.17.0"
2222
},

src/repository.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -995,11 +995,23 @@ export class Repository implements IDisposable {
995995
}
996996
});
997997
}
998-
998+
999999
private async unlocked<T>(): Promise<void> {
10001000
let attempt = 1;
10011001

1002-
while (attempt <= 10 && await exists(path.join(this.repository.root, '.hg', 'index.lock'))) {
1002+
const existsLocal = (path: string) => new Promise((resolve, reject) => {
1003+
fs.stat(path, (err) => {
1004+
if (err) {
1005+
if (err.code === 'ENOENT') {
1006+
return resolve(false);
1007+
}
1008+
reject(err);
1009+
}
1010+
return resolve(true);
1011+
});
1012+
});
1013+
1014+
while (attempt <= 10 && await existsLocal(path.join(this.repository.root, '.hg', 'index.lock'))) {
10031015
await timeout(Math.pow(attempt, 2) * 50);
10041016
attempt++;
10051017
}

0 commit comments

Comments
 (0)