diff src/org/tmatesoft/hg/core/HgFileInformer.java @ 415:ee8264d80747

Explicit constant for regular file flags, access to flags for a given file revision
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Thu, 22 Mar 2012 18:54:11 +0100
parents 0ae53c32ecef
children ccd7d25e5aea
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/core/HgFileInformer.java	Wed Mar 21 20:51:12 2012 +0100
+++ b/src/org/tmatesoft/hg/core/HgFileInformer.java	Thu Mar 22 18:54:11 2012 +0100
@@ -18,6 +18,7 @@
 
 import org.tmatesoft.hg.internal.ManifestRevision;
 import org.tmatesoft.hg.repo.HgDataFile;
+import org.tmatesoft.hg.repo.HgManifest;
 import org.tmatesoft.hg.repo.HgRepository;
 import org.tmatesoft.hg.util.Path;
 import org.tmatesoft.hg.util.Status;
@@ -121,6 +122,7 @@
 			return checkResult;
 		}
 		Nodeid toExtract = null;
+		HgManifest.Flags extractRevFlags = null;
 		String phaseMsg = "Extract manifest revision failed";
 		try {
 			if (cachedManifest == null) {
@@ -130,6 +132,7 @@
 				// cachedManifest shall be meaningful - changelog.getRevisionIndex() above ensures we've got version that exists.
 			}
 			toExtract = cachedManifest.nodeid(file);
+			extractRevFlags = cachedManifest.flags(file);
 			phaseMsg = "Follow copy/rename failed";
 			if (toExtract == null && followRenames) {
 				while (toExtract == null && dataFile.isCopy()) {
@@ -137,6 +140,7 @@
 					file = dataFile.getCopySourceName();
 					dataFile = repo.getFileNode(file);
 					toExtract = cachedManifest.nodeid(file);
+					extractRevFlags = cachedManifest.flags(file);
 				}
 			}
 		} catch (HgException ex) {
@@ -144,7 +148,7 @@
 			return checkResult;
 		}
 		if (toExtract != null) {
-			fileRevision = new HgFileRevision(repo, toExtract, dataFile.getPath());
+			fileRevision = new HgFileRevision(repo, toExtract, extractRevFlags, dataFile.getPath());
 			checkResult = new Status(Status.Kind.OK, String.format("File %s, revision %s found at changeset %s", dataFile.getPath(), toExtract.shortNotation(), cset.shortNotation()));
 			return checkResult;
 		}