# HG changeset patch # User Artem Tikhomirov # Date 1344877679 -7200 # Node ID 45b3b6ca046fcac472459e6ee1577e632fc36fc8 # Parent db48a77ec8ff4ef7962ad1e1999e394740d41b95 Repository locking mechanism is alive diff -r db48a77ec8ff -r 45b3b6ca046f src/org/tmatesoft/hg/repo/HgRepository.java --- a/src/org/tmatesoft/hg/repo/HgRepository.java Mon Aug 13 18:11:47 2012 +0200 +++ b/src/org/tmatesoft/hg/repo/HgRepository.java Mon Aug 13 19:07:59 2012 +0200 @@ -439,9 +439,10 @@ public HgRepositoryLock getWorkingDirLock() { if (wdLock == null) { int timeout = getLockTimeout(); + File lf = new File(getRepositoryRoot(), "wlock"); synchronized (this) { if (wdLock == null) { - wdLock = new HgRepositoryLock(new File(repoPathHelper.rewrite("wlock").toString()), timeout); + wdLock = new HgRepositoryLock(lf, timeout); } } } @@ -452,9 +453,10 @@ public HgRepositoryLock getStoreLock() { if (storeLock == null) { int timeout = getLockTimeout(); + File fl = new File(getRepositoryRoot(), repoPathHelper.rewrite("lock").toString()); synchronized (this) { if (storeLock == null) { - storeLock = new HgRepositoryLock(new File(repoPathHelper.rewrite("store/lock").toString()), timeout); + storeLock = new HgRepositoryLock(fl, timeout); } } } diff -r db48a77ec8ff -r 45b3b6ca046f src/org/tmatesoft/hg/repo/HgRepositoryLock.java --- a/src/org/tmatesoft/hg/repo/HgRepositoryLock.java Mon Aug 13 18:11:47 2012 +0200 +++ b/src/org/tmatesoft/hg/repo/HgRepositoryLock.java Mon Aug 13 19:07:59 2012 +0200 @@ -37,8 +37,8 @@ */ public class HgRepositoryLock { /* - * Lock .hg/ except .hg/store/ .hg/wlock (HgRepository.repoPathHelper("wlock")) - * Lock .hg/store/ .hg/store/lock (HgRepository.repoPathHelper("store/lock") ???) + * Lock .hg/ except .hg/store/ .hg/wlock (new File(hgRepo.getRepoRoot(),"wlock")) + * Lock .hg/store/ .hg/store/lock (HgRepository.repoPathHelper("lock")) */ private final File lockFile;