Mercurial > jhg
comparison 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 |
comparison
equal
deleted
inserted
replaced
443:072b5f3ed0c8 | 444:b3b1db9301a2 |
---|---|
76 public Nodeid getRevision() { | 76 public Nodeid getRevision() { |
77 return revision; | 77 return revision; |
78 } | 78 } |
79 | 79 |
80 /** | 80 /** |
81 * Executable or symbolic link, or <code>null</code> if regular file | 81 * Extract flags of the file as recorded in the manifest for this file revision |
82 * @return whether regular file, executable or a symbolic link | |
82 * @throws HgRuntimeException subclass thereof to indicate issues with the library. <em>Runtime exception</em> | 83 * @throws HgRuntimeException subclass thereof to indicate issues with the library. <em>Runtime exception</em> |
83 */ | 84 */ |
84 public HgManifest.Flags getFileFlags() throws HgRuntimeException { | 85 public HgManifest.Flags getFileFlags() throws HgRuntimeException { |
85 if (flags == null) { | 86 if (flags == null) { |
87 /* | |
88 * Note, for uses other than HgManifestCommand or HgChangesetFileSneaker, when no flags come through the cons, | |
89 * it's possible to face next shortcoming: | |
90 * Imagine csetA and csetB, with corresponding manifestA and manifestB, the file didn't change (revision/nodeid is the same) | |
91 * but flag of the file has changed (e.g. became executable). Since HgFileRevision doesn't keep reference to | |
92 * an actual manifest revision, but only file's, and it's likely the flags returned from this method would | |
93 * yield result as from manifestA (i.e. no flag change in manifestB ever noticed). | |
94 */ | |
86 HgDataFile df = repo.getFileNode(path); | 95 HgDataFile df = repo.getFileNode(path); |
87 int revIdx = df.getRevisionIndex(revision); | 96 int revIdx = df.getRevisionIndex(revision); |
88 flags = df.getFlags(revIdx); | 97 flags = df.getFlags(revIdx); |
89 } | 98 } |
90 return flags; | 99 return flags; |