diff src/org/tmatesoft/hg/internal/Internals.java @ 526:2f9ed6bcefa2

Initial support for Revert command with accompanying minor refactoring
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Tue, 15 Jan 2013 17:07:19 +0100
parents 0be5be8d57e9
children 0f6fa88e2162
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/internal/Internals.java	Fri Jan 11 18:12:39 2013 +0100
+++ b/src/org/tmatesoft/hg/internal/Internals.java	Tue Jan 15 17:07:19 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011-2012 TMate Software Ltd
+ * Copyright (c) 2011-2013 TMate Software Ltd
  *  
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -32,9 +32,11 @@
 import org.tmatesoft.hg.core.SessionContext;
 import org.tmatesoft.hg.repo.HgDataFile;
 import org.tmatesoft.hg.repo.HgInternals;
-import org.tmatesoft.hg.repo.HgRuntimeException;
 import org.tmatesoft.hg.repo.HgRepoConfig.ExtensionsSection;
 import org.tmatesoft.hg.repo.HgRepository;
+import org.tmatesoft.hg.repo.HgRepositoryFiles;
+import org.tmatesoft.hg.repo.HgRepositoryLock;
+import org.tmatesoft.hg.repo.HgRuntimeException;
 import org.tmatesoft.hg.util.PathRewrite;
 
 /**
@@ -117,6 +119,10 @@
 		return !repoDir.exists() || !repoDir.isDirectory();
 	}
 	
+	public File getRepositoryFile(HgRepositoryFiles f) {
+		return f.residesUnderRepositoryRoot() ? getFileFromRepoDir(f.getName()) : getFileFromDataDir(f.getName());
+	}
+
 	/**
 	 * Access files under ".hg/".
 	 * File not necessarily exists, this method is merely a factory for Files at specific, configuration-dependent location. 
@@ -222,7 +228,7 @@
 		return dataPathHelper.rewrite(df.getPath().toString());
 	}
 
-
+	
 	public static boolean runningOnWindows() {
 		return System.getProperty("os.name").indexOf("Windows") != -1;
 	}
@@ -411,6 +417,11 @@
 		return shallCacheRevlogsInRepo;
 	}
 	
+	// marker method
+	public static IllegalStateException notImplemented() {
+		return new IllegalStateException("Not implemented");
+	}
+
 	public static Internals getInstance(HgRepository repo) {
 		return HgInternals.getImplementationRepo(repo);
 	}