Mercurial > jhg
diff src/org/tmatesoft/hg/internal/RevlogStreamWriter.java @ 628:6526d8adbc0f
Explicit HgRuntimeException to facilitate easy switch from runtime to checked exceptions
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Wed, 22 May 2013 15:52:31 +0200 |
parents | 7c0d2ce340b8 |
children | 14dac192aa26 |
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/internal/RevlogStreamWriter.java Tue May 21 20:17:33 2013 +0200 +++ b/src/org/tmatesoft/hg/internal/RevlogStreamWriter.java Wed May 22 15:52:31 2013 +0200 @@ -29,7 +29,9 @@ import org.tmatesoft.hg.internal.DataSerializer.ByteArrayDataSource; import org.tmatesoft.hg.internal.DataSerializer.DataSource; import org.tmatesoft.hg.repo.HgInvalidControlFileException; +import org.tmatesoft.hg.repo.HgInvalidRevisionException; import org.tmatesoft.hg.repo.HgInvalidStateException; +import org.tmatesoft.hg.repo.HgRuntimeException; /** * @@ -61,8 +63,9 @@ /** * @return nodeid of added revision + * @throws HgRuntimeException */ - public Nodeid addRevision(DataSource content, int linkRevision, int p1, int p2) throws HgIOException { + public Nodeid addRevision(DataSource content, int linkRevision, int p1, int p2) throws HgIOException, HgRuntimeException { lastEntryRevision = Nodeid.NULL; int revCount = revlogStream.revisionCount(); lastEntryIndex = revCount == 0 ? NO_REVISION : revCount - 1; @@ -138,13 +141,13 @@ return lastEntryRevision; } - private byte[] toByteArray(DataSource content) throws HgIOException { + private byte[] toByteArray(DataSource content) throws HgIOException, HgRuntimeException { ByteArrayDataSerializer ba = new ByteArrayDataSerializer(); content.serialize(ba); return ba.toByteArray(); } - private Nodeid revision(int revisionIndex) { + private Nodeid revision(int revisionIndex) throws HgInvalidControlFileException, HgInvalidRevisionException { if (revisionIndex == NO_REVISION) { return Nodeid.NULL; } @@ -156,7 +159,7 @@ return n; } - private void populateLastEntry() throws HgInvalidControlFileException { + private void populateLastEntry() throws HgRuntimeException { if (lastEntryContent != null) { return; }