comparison src/com/tmate/hgkit/ll/LocalHgRepo.java @ 1:a3576694a4d1

Repository detection from local/specified directory
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Sat, 18 Dec 2010 05:47:35 +0100
parents
children 24bb4f365164
comparison
equal deleted inserted replaced
0:dbd663faec1f 1:a3576694a4d1
1 /**
2 * Copyright (c) 2010 Artem Tikhomirov
3 */
4 package com.tmate.hgkit.ll;
5
6 import java.io.File;
7 import java.io.IOException;
8
9 /**
10 * @author artem
11 */
12 public class LocalHgRepo extends HgRepository {
13
14 private File repoDir;
15 private final String repoLocation;
16
17 public LocalHgRepo(String repositoryPath) {
18 setInvalid(true);
19 repoLocation = repositoryPath;
20 }
21
22 public LocalHgRepo(File repositoryRoot) throws IOException {
23 assert ".hg".equals(repositoryRoot.getName()) && repositoryRoot.isDirectory();
24 setInvalid(false);
25 repoDir = repositoryRoot;
26 repoLocation = repositoryRoot.getParentFile().getCanonicalPath();
27 }
28
29 @Override
30 public String getLocation() {
31 return repoLocation;
32 }
33 }