Mercurial > jhg
comparison src/org/tmatesoft/hg/core/HgCatCommand.java @ 248:3fbfce107f94
Issue 8: Means to find out information about given file at specific changeset. Inner ManifestRevisionInspector got promoted to ManifestRevision
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Fri, 12 Aug 2011 18:48:57 +0200 |
parents | 6e1373b54e9b |
children | d68dcb3b5f49 |
comparison
equal
deleted
inserted
replaced
247:f052f40839ec | 248:3fbfce107f94 |
---|---|
96 revision = nodeid; | 96 revision = nodeid; |
97 localRevision = BAD_REVISION; | 97 localRevision = BAD_REVISION; |
98 cset = null; | 98 cset = null; |
99 return this; | 99 return this; |
100 } | 100 } |
101 | |
102 /** | |
103 * Parameterize the command from file revision object. | |
104 * | |
105 * @param fileRev file revision to cat | |
106 * @return <code>this</code> for convenience | |
107 */ | |
108 public HgCatCommand revision(HgFileRevision fileRev) { | |
109 return file(fileRev.getPath()).revision(fileRev.getRevision()); | |
110 } | |
101 | 111 |
102 /** | 112 /** |
103 * Select whatever revision of the file that was actual at the time of the specified changeset. Unlike {@link #revision(int)} or {@link #revision(Nodeid)}, this method | 113 * Select whatever revision of the file that was actual at the time of the specified changeset. Unlike {@link #revision(int)} or {@link #revision(Nodeid)}, this method |
104 * operates in terms of repository global revisions (aka changesets). | 114 * operates in terms of repository global revisions (aka changesets). |
105 * | 115 * |
150 break; | 160 break; |
151 } | 161 } |
152 } | 162 } |
153 } while (toExtract == null); | 163 } while (toExtract == null); |
154 if (toExtract == null) { | 164 if (toExtract == null) { |
155 throw new HgBadStateException(String.format("File %s not its origins were not known at repository %s revision", file, cset.shortNotation())); | 165 throw new HgBadStateException(String.format("File %s nor its origins were not known at repository %s revision", file, cset.shortNotation())); |
156 } | 166 } |
157 revToExtract = dataFile.getLocalRevision(toExtract); | 167 revToExtract = dataFile.getLocalRevision(toExtract); |
158 } else if (revision != null) { | 168 } else if (revision != null) { |
159 revToExtract = dataFile.getLocalRevision(revision); | 169 revToExtract = dataFile.getLocalRevision(revision); |
160 } else { | 170 } else { |