Mercurial > jhg
diff src/org/tmatesoft/hg/core/HgFileRevision.java @ 444:b3b1db9301a2
Few comments that emerged while working on examples
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Tue, 15 May 2012 20:19:22 +0200 |
parents | 12f668401613 |
children | 5dcb4581c8ef |
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/core/HgFileRevision.java Fri May 04 17:59:22 2012 +0200 +++ b/src/org/tmatesoft/hg/core/HgFileRevision.java Tue May 15 20:19:22 2012 +0200 @@ -78,11 +78,20 @@ } /** - * Executable or symbolic link, or <code>null</code> if regular file + * Extract flags of the file as recorded in the manifest for this file revision + * @return whether regular file, executable or a symbolic link * @throws HgRuntimeException subclass thereof to indicate issues with the library. <em>Runtime exception</em> */ public HgManifest.Flags getFileFlags() throws HgRuntimeException { if (flags == null) { + /* + * Note, for uses other than HgManifestCommand or HgChangesetFileSneaker, when no flags come through the cons, + * it's possible to face next shortcoming: + * Imagine csetA and csetB, with corresponding manifestA and manifestB, the file didn't change (revision/nodeid is the same) + * but flag of the file has changed (e.g. became executable). Since HgFileRevision doesn't keep reference to + * an actual manifest revision, but only file's, and it's likely the flags returned from this method would + * yield result as from manifestA (i.e. no flag change in manifestB ever noticed). + */ HgDataFile df = repo.getFileNode(path); int revIdx = df.getRevisionIndex(revision); flags = df.getFlags(revIdx);