diff src/org/tmatesoft/hg/repo/HgManifest.java @ 608:e1b29756f901

Clean, organize and resolve some TODOs and FIXMEs: minor refactorings and comments
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Tue, 07 May 2013 21:27:51 +0200
parents 66f1cc23b906
children 6526d8adbc0f
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/repo/HgManifest.java	Tue May 07 16:52:46 2013 +0200
+++ b/src/org/tmatesoft/hg/repo/HgManifest.java	Tue May 07 21:27:51 2013 +0200
@@ -109,7 +109,19 @@
 			}
 			throw new IllegalStateException(new String(data, start, length));
 		}
-
+		
+		static Flags parse(int dirstateFileMode) {
+			// source/include/linux/stat.h
+			final int S_IFLNK = 0120000, S_IXUSR = 00100;
+			if ((dirstateFileMode & S_IFLNK) == S_IFLNK) {
+				return Link;
+			}
+			if ((dirstateFileMode & S_IXUSR) == S_IXUSR) {
+				return Exec;
+			}
+			return RegularFile;
+		}
+		
 		String nativeString() {
 			if (this == Exec) {
 				return "x";