diff src/org/tmatesoft/hg/repo/HgRepository.java @ 488:45b3b6ca046f

Repository locking mechanism is alive
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Mon, 13 Aug 2012 19:07:59 +0200
parents db48a77ec8ff
children b3c16d1aede0
line wrap: on
line diff
--- 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);
 				}
 			}
 		}