Mercurial > hg4j
comparison src/org/tmatesoft/hg/repo/Revlog.java @ 88:61eedab3eb3e
Status between two revisions to recognize copy/rename
| author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
|---|---|
| date | Wed, 26 Jan 2011 05:46:47 +0100 |
| parents | 4222b04f34ee |
| children | a3a2e5deb320 |
comparison
equal
deleted
inserted
replaced
| 87:25f2e5d1cd8b | 88:61eedab3eb3e |
|---|---|
| 58 | 58 |
| 59 public int getRevisionCount() { | 59 public int getRevisionCount() { |
| 60 return content.revisionCount(); | 60 return content.revisionCount(); |
| 61 } | 61 } |
| 62 | 62 |
| 63 public Nodeid getRevisionNumber(int revision) { | 63 public Nodeid getRevision(int revision) { |
| 64 // XXX cache nodeids? | 64 // XXX cache nodeids? |
| 65 return Nodeid.fromBinary(content.nodeid(revision), 0); | 65 return Nodeid.fromBinary(content.nodeid(revision), 0); |
| 66 } | 66 } |
| 67 | 67 |
| 68 public int getLocalRevisionNumber(Nodeid nid) { | 68 public int getLocalRevision(Nodeid nid) { |
| 69 int revision = content.findLocalRevisionNumber(nid); | 69 int revision = content.findLocalRevisionNumber(nid); |
| 70 if (revision == BAD_REVISION) { | 70 if (revision == BAD_REVISION) { |
| 71 throw new IllegalArgumentException(String.format("%s doesn't represent a revision of %s", nid.toString(), this /*XXX HgDataFile.getPath might be more suitable here*/)); | 71 throw new IllegalArgumentException(String.format("%s doesn't represent a revision of %s", nid.toString(), this /*XXX HgDataFile.getPath might be more suitable here*/)); |
| 72 } | 72 } |
| 73 return revision; | 73 return revision; |
| 89 /** | 89 /** |
| 90 * Access to revision data as is (decompressed, but otherwise unprocessed, i.e. not parsed for e.g. changeset or manifest entries) | 90 * Access to revision data as is (decompressed, but otherwise unprocessed, i.e. not parsed for e.g. changeset or manifest entries) |
| 91 * @param nodeid | 91 * @param nodeid |
| 92 */ | 92 */ |
| 93 public byte[] content(Nodeid nodeid) { | 93 public byte[] content(Nodeid nodeid) { |
| 94 return content(getLocalRevisionNumber(nodeid)); | 94 return content(getLocalRevision(nodeid)); |
| 95 } | 95 } |
| 96 | 96 |
| 97 /** | 97 /** |
| 98 * @param revision - repo-local index of this file change (not a changelog revision number!) | 98 * @param revision - repo-local index of this file change (not a changelog revision number!) |
| 99 */ | 99 */ |
