diff src/org/tmatesoft/hg/internal/Internals.java @ 413:7f27122011c3

Support and respect for symbolic links and executable flag, with /bin/ls backed implementation to discover these
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Wed, 21 Mar 2012 20:40:28 +0100
parents b015f3918120
children bb278ccf9866
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/internal/Internals.java	Thu Mar 15 16:51:46 2012 +0100
+++ b/src/org/tmatesoft/hg/internal/Internals.java	Wed Mar 21 20:40:28 2012 +0100
@@ -162,6 +162,29 @@
 	}
 	
 	/**
+	 * @param hint optional hint pointing to filesystem of interest (generally, it's possible to mount 
+	 * filesystems with different capabilities and repository's capabilities would depend on which fs it resides) 
+	 * @return <code>true</code> if executable files deserve tailored handling 
+	 */
+	public static boolean checkSupportsExecutables(File fsHint) {
+		// *.exe are not executables for Mercurial
+		return !runningOnWindows();
+	}
+
+	/**
+	 * @param hint optional hint pointing to filesystem of interest (generally, it's possible to mount 
+	 * filesystems with different capabilities and repository's capabilities would depend on which fs it resides) 
+	 * @return <code>true</code> if filesystem knows what symbolic links are 
+	 */
+	public static boolean checkSupportsSymlinks(File fsHint) {
+		// Windows supports soft symbolic links starting from Vista 
+		// However, as of Mercurial 2.1.1, no support for this functionality
+		// XXX perhaps, makes sense to override with a property a) to speed up when no links are in use b) investigate how this runs windows
+		return !runningOnWindows();
+	}
+
+	
+	/**
 	 * For Unix, returns installation root, which is the parent directory of the hg executable (or symlink) being run.
 	 * For Windows, it's Mercurial installation directory itself 
 	 * @param ctx