diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/com/tmate/hgkit/ll/LocalHgRepo.java	Sat Dec 18 05:47:35 2010 +0100
@@ -0,0 +1,33 @@
+/**
+ * Copyright (c) 2010 Artem Tikhomirov 
+ */
+package com.tmate.hgkit.ll;
+
+import java.io.File;
+import java.io.IOException;
+
+/**
+ * @author artem
+ */
+public class LocalHgRepo extends HgRepository {
+
+	private File repoDir;
+	private final String repoLocation;
+
+	public LocalHgRepo(String repositoryPath) {
+		setInvalid(true);
+		repoLocation = repositoryPath;
+	}
+	
+	public LocalHgRepo(File repositoryRoot) throws IOException {
+		assert ".hg".equals(repositoryRoot.getName()) && repositoryRoot.isDirectory();
+		setInvalid(false);
+		repoDir = repositoryRoot;
+		repoLocation = repositoryRoot.getParentFile().getCanonicalPath();
+	}
+
+	@Override
+	public String getLocation() {
+		return repoLocation;
+	}
+}