Mercurial > hg4j
diff src/com/tmate/hgkit/ll/HgDataFile.java @ 5:fc265ddeab26
File content and non-effective, although working, patch application
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Tue, 21 Dec 2010 05:11:06 +0100 |
parents | 24bb4f365164 |
children | 571e1b2cc3f7 |
line wrap: on
line diff
--- a/src/com/tmate/hgkit/ll/HgDataFile.java Mon Dec 20 04:20:52 2010 +0100 +++ b/src/com/tmate/hgkit/ll/HgDataFile.java Tue Dec 21 05:11:06 2010 +0100 @@ -3,6 +3,8 @@ */ package com.tmate.hgkit.ll; +import static com.tmate.hgkit.ll.HgRepository.TIP; + /** * Extends Revlog/uses RevlogStream? * ? name:HgFileNode? @@ -31,14 +33,23 @@ return path; // hgRepo.backresolve(this) -> name? } - private static final int TIP = -2; + public int getRevisionCount() { + return content.revisionCount(); + } public byte[] content() { return content(TIP); } public byte[] content(int revision) { - throw HgRepository.notImplemented(); + final byte[][] dataPtr = new byte[1][]; + Revlog.Inspector insp = new Revlog.Inspector() { + public void next(int revisionNumber, int actualLen, int baseRevision, int linkRevision, int parent1Revision, int parent2Revision, byte[] nodeid, byte[] data) { + dataPtr[0] = data; + } + }; + content.iterate(revision, revision, true, insp); + return dataPtr[0]; } public void history(Changeset.Inspector inspector) {