Mercurial > jhg
comparison src/com/tmate/hgkit/ll/Revlog.java @ 21:e929cecae4e1
Refactor to move revlog content to base class
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Wed, 05 Jan 2011 04:10:28 +0100 |
parents | 24bb4f365164 |
children | 603806cd2dc6 |
comparison
equal
deleted
inserted
replaced
20:11cfabe692b3 | 21:e929cecae4e1 |
---|---|
8 * @author artem | 8 * @author artem |
9 */ | 9 */ |
10 public abstract class Revlog { | 10 public abstract class Revlog { |
11 | 11 |
12 private final HgRepository hgRepo; | 12 private final HgRepository hgRepo; |
13 protected final RevlogStream content; | |
13 | 14 |
14 protected Revlog(HgRepository hgRepo) { | 15 protected Revlog(HgRepository hgRepo, RevlogStream content) { |
15 if (hgRepo == null) { | 16 if (hgRepo == null) { |
16 throw new NullPointerException(); | 17 throw new NullPointerException(); |
17 } | 18 } |
18 this.hgRepo = hgRepo; | 19 this.hgRepo = hgRepo; |
20 this.content = content; | |
19 } | 21 } |
20 | 22 |
21 public final HgRepository getRepo() { | 23 public final HgRepository getRepo() { |
22 return hgRepo; | 24 return hgRepo; |
25 } | |
26 | |
27 public int getRevisionCount() { | |
28 return content.revisionCount(); | |
23 } | 29 } |
24 | 30 |
25 public interface Inspector { | 31 public interface Inspector { |
26 // XXX boolean retVal to indicate whether to continue? | 32 // XXX boolean retVal to indicate whether to continue? |
27 void next(int revisionNumber, int actualLen, int baseRevision, int linkRevision, int parent1Revision, int parent2Revision, byte[/*32*/] nodeid, byte[] data); | 33 void next(int revisionNumber, int actualLen, int baseRevision, int linkRevision, int parent1Revision, int parent2Revision, byte[/*32*/] nodeid, byte[] data); |