diff src/org/tmatesoft/hg/repo/HgRepository.java @ 148:1a7a9a20e1f9

Exceptions, javadoc. Initial cancel and progress support
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Wed, 23 Feb 2011 22:36:28 +0100
parents acc6151b1b7a
children 3a7696fb457c
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/repo/HgRepository.java	Tue Feb 22 15:49:26 2011 +0100
+++ b/src/org/tmatesoft/hg/repo/HgRepository.java	Wed Feb 23 22:36:28 2011 +0100
@@ -45,6 +45,7 @@
  */
 public final class HgRepository {
 
+	// if new constants added, consider fixing HgInternals#badLocalRevision
 	public static final int TIP = -1;
 	public static final int BAD_REVISION = Integer.MIN_VALUE;
 	public static final int WORKING_COPY = -2;
@@ -53,7 +54,7 @@
 	public static IllegalStateException notImplemented() {
 		return new IllegalStateException("Not implemented");
 	}
-
+	
 	private final File repoDir; // .hg folder
 	private final String repoLocation;
 	private final DataAccessProvider dataAccess;
@@ -79,10 +80,12 @@
 		normalizePath = null;
 	}
 	
-	HgRepository(File repositoryRoot) throws IOException {
+	HgRepository(String repositoryPath, File repositoryRoot) {
 		assert ".hg".equals(repositoryRoot.getName()) && repositoryRoot.isDirectory();
+		assert repositoryPath != null; 
+		assert repositoryRoot != null;
 		repoDir = repositoryRoot;
-		repoLocation = repositoryRoot.getParentFile().getCanonicalPath();
+		repoLocation = repositoryPath;
 		dataAccess = new DataAccessProvider();
 		final boolean runningOnWindows = System.getProperty("os.name").indexOf("Windows") != -1;
 		if (runningOnWindows) {