Mercurial > hg4j
diff src/com/tmate/hgkit/ll/HgRepository.java @ 2:08db726a0fb7
Shaping out low-level Hg structures
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Sun, 19 Dec 2010 05:41:31 +0100 |
parents | a3576694a4d1 |
children | 24bb4f365164 |
line wrap: on
line diff
--- a/src/com/tmate/hgkit/ll/HgRepository.java Sat Dec 18 05:47:35 2010 +0100 +++ b/src/com/tmate/hgkit/ll/HgRepository.java Sun Dec 19 05:41:31 2010 +0100 @@ -6,12 +6,18 @@ /** * @author artem - * */ public abstract class HgRepository { + // temp aux marker method + public static IllegalStateException notImplemented() { + return new IllegalStateException("Not implemented"); + } + private Changelog changelog; + private HgManifest manifest; + private boolean isInvalid = true; public boolean isInvalid() { @@ -23,21 +29,38 @@ } public void log() { - Changelog clog = getChangelog(); + Revlog clog = getChangelog(); assert clog != null; // TODO get data to the client } - /** - * @return - */ - private Changelog getChangelog() { + public final Changelog getChangelog() { if (this.changelog == null) { - this.changelog = new Changelog(); + // might want delegate to protected createChangelog() some day + this.changelog = new Changelog(this); // TODO init } return this.changelog; } + + public final HgManifest getManifest() { + if (this.manifest == null) { + this.manifest = new HgManifest(this); + } + return this.manifest; + } + + public final Object/*HgDirstate*/ getDirstate() { + throw notImplemented(); + } + + public abstract HgDataFile getFileNode(String path); public abstract String getLocation(); + + + /** + * Perhaps, should be separate interface, like ContentLookup + */ + public abstract RevlogStream resolve(String string); }