Mercurial > jhg
comparison 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 |
comparison
equal
deleted
inserted
replaced
1:a3576694a4d1 | 2:08db726a0fb7 |
---|---|
4 package com.tmate.hgkit.ll; | 4 package com.tmate.hgkit.ll; |
5 | 5 |
6 | 6 |
7 /** | 7 /** |
8 * @author artem | 8 * @author artem |
9 * | |
10 */ | 9 */ |
11 public abstract class HgRepository { | 10 public abstract class HgRepository { |
12 | 11 |
12 // temp aux marker method | |
13 public static IllegalStateException notImplemented() { | |
14 return new IllegalStateException("Not implemented"); | |
15 } | |
16 | |
13 | 17 |
14 private Changelog changelog; | 18 private Changelog changelog; |
19 private HgManifest manifest; | |
20 | |
15 private boolean isInvalid = true; | 21 private boolean isInvalid = true; |
16 | 22 |
17 public boolean isInvalid() { | 23 public boolean isInvalid() { |
18 return this.isInvalid; | 24 return this.isInvalid; |
19 } | 25 } |
21 protected void setInvalid(boolean invalid) { | 27 protected void setInvalid(boolean invalid) { |
22 isInvalid = invalid; | 28 isInvalid = invalid; |
23 } | 29 } |
24 | 30 |
25 public void log() { | 31 public void log() { |
26 Changelog clog = getChangelog(); | 32 Revlog clog = getChangelog(); |
27 assert clog != null; | 33 assert clog != null; |
28 // TODO get data to the client | 34 // TODO get data to the client |
29 } | 35 } |
30 | 36 |
31 /** | 37 public final Changelog getChangelog() { |
32 * @return | |
33 */ | |
34 private Changelog getChangelog() { | |
35 if (this.changelog == null) { | 38 if (this.changelog == null) { |
36 this.changelog = new Changelog(); | 39 // might want delegate to protected createChangelog() some day |
40 this.changelog = new Changelog(this); | |
37 // TODO init | 41 // TODO init |
38 } | 42 } |
39 return this.changelog; | 43 return this.changelog; |
40 } | 44 } |
45 | |
46 public final HgManifest getManifest() { | |
47 if (this.manifest == null) { | |
48 this.manifest = new HgManifest(this); | |
49 } | |
50 return this.manifest; | |
51 } | |
52 | |
53 public final Object/*HgDirstate*/ getDirstate() { | |
54 throw notImplemented(); | |
55 } | |
56 | |
57 public abstract HgDataFile getFileNode(String path); | |
41 | 58 |
42 public abstract String getLocation(); | 59 public abstract String getLocation(); |
60 | |
61 | |
62 /** | |
63 * Perhaps, should be separate interface, like ContentLookup | |
64 */ | |
65 public abstract RevlogStream resolve(String string); | |
43 } | 66 } |