Mercurial > jhg
comparison src/org/tmatesoft/hg/repo/HgDataFile.java @ 355:f2c11fe7f3e9
Newline filter shall respect whole stream when deciding whether to process line terminators, hence added stream preview functionality
| author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
|---|---|
| date | Tue, 06 Dec 2011 12:57:21 +0100 |
| parents | 5f9073eabf06 |
| children | 189dc6dc1c3e |
comparison
equal
deleted
inserted
replaced
| 354:5f9073eabf06 | 355:f2c11fe7f3e9 |
|---|---|
| 157 getRepo().getContext().getLog().info(getClass(), ex, null); | 157 getRepo().getContext().getLog().info(getClass(), ex, null); |
| 158 } | 158 } |
| 159 } | 159 } |
| 160 } | 160 } |
| 161 } else { | 161 } else { |
| 162 // FIXME not TIP, but revision according to dirstate!!! | |
| 163 // add tests for this case | |
| 162 contentWithFilters(TIP, sink); | 164 contentWithFilters(TIP, sink); |
| 163 } | 165 } |
| 164 } | 166 } |
| 165 | 167 |
| 166 // public void content(int revision, ByteChannel sink, boolean applyFilters) throws HgDataStreamException, IOException, CancelledException { | 168 // public void content(int revision, ByteChannel sink, boolean applyFilters) throws HgDataStreamException, IOException, CancelledException { |
| 217 if (metadata == null) { | 219 if (metadata == null) { |
| 218 metadata = new Metadata(); | 220 metadata = new Metadata(); |
| 219 } | 221 } |
| 220 ErrorHandlingInspector insp; | 222 ErrorHandlingInspector insp; |
| 221 if (metadata.none(revision)) { | 223 if (metadata.none(revision)) { |
| 222 insp = new ContentPipe(sink, 0); | 224 insp = new ContentPipe(sink, 0, getRepo().getContext().getLog()); |
| 223 } else if (metadata.known(revision)) { | 225 } else if (metadata.known(revision)) { |
| 224 insp = new ContentPipe(sink, metadata.dataOffset(revision)); | 226 insp = new ContentPipe(sink, metadata.dataOffset(revision), getRepo().getContext().getLog()); |
| 225 } else { | 227 } else { |
| 226 // do not know if there's metadata | 228 // do not know if there's metadata |
| 227 insp = new MetadataInspector(metadata, getPath(), new ContentPipe(sink, 0)); | 229 insp = new MetadataInspector(metadata, getPath(), new ContentPipe(sink, 0, getRepo().getContext().getLog())); |
| 228 } | 230 } |
| 229 insp.checkCancelled(); | 231 insp.checkCancelled(); |
| 230 super.content.iterate(revision, revision, true, insp); | 232 super.content.iterate(revision, revision, true, insp); |
| 231 try { | 233 try { |
| 232 insp.checkFailed(); // XXX is there real need to throw IOException from ContentPipe? | 234 insp.checkFailed(); // XXX is there real need to throw IOException from ContentPipe? |
