comparison src/org/tmatesoft/hg/repo/HgDataFile.java @ 380:9517df1ef7ec

Comments/javadoc
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Thu, 09 Feb 2012 18:57:14 +0100
parents 8107b95f4280
children 994b5813a925
comparison
equal deleted inserted replaced
379:fa2be7a05af6 380:9517df1ef7ec
90 * Handy shorthand for {@link #length(int) length(getRevisionIndex(nodeid))} 90 * Handy shorthand for {@link #length(int) length(getRevisionIndex(nodeid))}
91 * 91 *
92 * @param nodeid revision of the file 92 * @param nodeid revision of the file
93 * 93 *
94 * @return size of the file content at the given revision 94 * @return size of the file content at the given revision
95 * @throws HgInvalidRevisionException if supplied argument doesn't represent revision index in this revlog 95 * @throws HgInvalidRevisionException if supplied nodeid doesn't identify any revision from this revlog
96 * @throws HgDataStreamException if attempt to access file metadata failed 96 * @throws HgDataStreamException if attempt to access file metadata failed
97 * @throws HgInvalidControlFileException if access to revlog index/data entry failed 97 * @throws HgInvalidControlFileException if access to revlog index/data entry failed
98 */ 98 */
99 public int length(Nodeid nodeid) throws HgDataStreamException, HgInvalidControlFileException, HgInvalidRevisionException { 99 public int length(Nodeid nodeid) throws HgDataStreamException, HgInvalidControlFileException, HgInvalidRevisionException {
100 return length(getRevisionIndex(nodeid)); 100 return length(getRevisionIndex(nodeid));
125 * as if it would be refreshed in the working copy, i.e. its corresponding revision 125 * as if it would be refreshed in the working copy, i.e. its corresponding revision
126 * (XXX according to dirstate? file tip?) is read from the repository, and filters repo -> working copy get applied. 126 * (XXX according to dirstate? file tip?) is read from the repository, and filters repo -> working copy get applied.
127 * 127 *
128 * @param sink where to pipe content to 128 * @param sink where to pipe content to
129 * @throws HgDataStreamException to indicate troubles reading repository file 129 * @throws HgDataStreamException to indicate troubles reading repository file
130 * @throws CancelledException if operation was cancelled 130 * @throws CancelledException if execution of the operation was cancelled
131 */ 131 */
132 public void workingCopy(ByteChannel sink) throws HgDataStreamException, HgInvalidControlFileException, CancelledException { 132 public void workingCopy(ByteChannel sink) throws HgDataStreamException, HgInvalidControlFileException, CancelledException {
133 File f = getRepo().getFile(this); 133 File f = getRepo().getFile(this);
134 if (f.exists()) { 134 if (f.exists()) {
135 final CancelSupport cs = CancelSupport.Factory.get(sink); 135 final CancelSupport cs = CancelSupport.Factory.get(sink);
203 /** 203 /**
204 * 204 *
205 * @param fileRevisionIndex - revision local index, non-negative. From predefined constants, {@link HgRepository#TIP} and {@link HgRepository#WORKING_COPY} make sense. 205 * @param fileRevisionIndex - revision local index, non-negative. From predefined constants, {@link HgRepository#TIP} and {@link HgRepository#WORKING_COPY} make sense.
206 * @param sink 206 * @param sink
207 * @throws HgDataStreamException FIXME 207 * @throws HgDataStreamException FIXME
208 * @throws HgInvalidControlFileException 208 * @throws HgInvalidControlFileException if access to revlog index/data entry failed
209 * @throws CancelledException 209 * @throws CancelledException if execution of the operation was cancelled
210 * @throws HgInvalidRevisionException 210 * @throws HgInvalidRevisionException if supplied argument doesn't represent revision index in this revlog
211 */ 211 */
212 public void content(int fileRevisionIndex, ByteChannel sink) throws HgDataStreamException, HgInvalidControlFileException, CancelledException, HgInvalidRevisionException { 212 public void content(int fileRevisionIndex, ByteChannel sink) throws HgDataStreamException, HgInvalidControlFileException, CancelledException, HgInvalidRevisionException {
213 // for data files need to check heading of the file content for possible metadata 213 // for data files need to check heading of the file content for possible metadata
214 // @see http://mercurial.selenic.com/wiki/FileFormats#data.2BAC8- 214 // @see http://mercurial.selenic.com/wiki/FileFormats#data.2BAC8-
215 if (fileRevisionIndex == TIP) { 215 if (fileRevisionIndex == TIP) {