diff src/org/tmatesoft/hg/repo/HgDataFile.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 a57a21aa4190
children d30083c80d52
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/repo/HgDataFile.java	Wed Mar 21 20:51:12 2012 +0100
+++ b/src/org/tmatesoft/hg/repo/HgDataFile.java	Thu Mar 22 18:54:11 2012 +0100
@@ -528,13 +528,36 @@
 		throw new UnsupportedOperationException(); // XXX REVISIT, think over if Exception is good (clients would check isCopy() anyway, perhaps null is sufficient?)
 	}
 	
+	/**
+	 * 
+	 * @return revision this file was copied from
+	 * @throws HgInvalidControlFileException if access to revlog or file metadata failed
+	 * @throws UnsupportedOperationException if this file doesn't represent a copy ({@link #isCopy()} was false)
+	 */
 	public Nodeid getCopySourceRevision() throws HgInvalidControlFileException {
 		if (isCopy()) {
 			return Nodeid.fromAscii(metadata.find(0, "copyrev")); // XXX reuse/cache Nodeid
 		}
 		throw new UnsupportedOperationException();
 	}
+/* FIXME	
+	public Nodeid getRevisionAtChangeset(int changesetRevision) {
+	}
 	
+	public HgManifest.Flags getFlagsAtChangeset(int changesetRevisionIndex) {
+	}
+*/
+	
+	/**
+	 * FIXME EXCEPTIONS 
+	 * @throws HgInvalidControlFileException
+	 * @throws HgInvalidRevisionException
+	 */
+	public HgManifest.Flags getFlags(int fileRevisionIndex) throws HgInvalidControlFileException, HgInvalidRevisionException {
+		int changesetRevIndex = getChangesetRevisionIndex(fileRevisionIndex);
+		return getRepo().getManifest().extractFlags(changesetRevIndex, getPath());
+	}
+
 	@Override
 	public String toString() {
 		StringBuilder sb = new StringBuilder(getClass().getSimpleName());