comparison src/org/tmatesoft/hg/repo/HgRepository.java @ 647:c75297c17867

Location of repository files as enumeration, use file constants instead of plain names
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Tue, 25 Jun 2013 18:53:18 +0200
parents ffce73efa2c2
children 12a4f60ea972
comparison
equal deleted inserted replaced
646:3b7d51ed4c65 647:c75297c17867
14 * the terms of a license other than GNU General Public License 14 * the terms of a license other than GNU General Public License
15 * contact TMate Software at support@hg4j.com 15 * contact TMate Software at support@hg4j.com
16 */ 16 */
17 package org.tmatesoft.hg.repo; 17 package org.tmatesoft.hg.repo;
18 18
19 import static org.tmatesoft.hg.repo.HgRepositoryFiles.LastMessage; 19 import static org.tmatesoft.hg.repo.HgRepositoryFiles.*;
20 import static org.tmatesoft.hg.util.LogFacility.Severity.Warn; 20 import static org.tmatesoft.hg.util.LogFacility.Severity.Warn;
21 21
22 import java.io.File; 22 import java.io.File;
23 import java.io.FileReader; 23 import java.io.FileReader;
24 import java.io.IOException; 24 import java.io.IOException;
387 * @return lock object, never <code>null</code> 387 * @return lock object, never <code>null</code>
388 */ 388 */
389 public HgRepositoryLock getWorkingDirLock() { 389 public HgRepositoryLock getWorkingDirLock() {
390 if (wdLock == null) { 390 if (wdLock == null) {
391 int timeout = getLockTimeout(); 391 int timeout = getLockTimeout();
392 File lf = impl.getFileFromRepoDir("wlock"); 392 File lf = impl.getRepositoryFile(WorkingCopyLock);
393 synchronized (this) { 393 synchronized (this) {
394 if (wdLock == null) { 394 if (wdLock == null) {
395 wdLock = new HgRepositoryLock(lf, timeout); 395 wdLock = new HgRepositoryLock(lf, timeout);
396 } 396 }
397 } 397 }
405 * @return lock object, never <code>null</code> 405 * @return lock object, never <code>null</code>
406 */ 406 */
407 public HgRepositoryLock getStoreLock() { 407 public HgRepositoryLock getStoreLock() {
408 if (storeLock == null) { 408 if (storeLock == null) {
409 int timeout = getLockTimeout(); 409 int timeout = getLockTimeout();
410 File fl = impl.getFileFromStoreDir("lock"); 410 File fl = impl.getRepositoryFile(StoreLock);
411 synchronized (this) { 411 synchronized (this) {
412 if (storeLock == null) { 412 if (storeLock == null) {
413 storeLock = new HgRepositoryLock(fl, timeout); 413 storeLock = new HgRepositoryLock(fl, timeout);
414 } 414 }
415 } 415 }