comparison src/org/tmatesoft/hg/core/HgLogCommand.java @ 249:4c3b9f679412

Deprecated HgLogCommand.FileRevision gone, top-level HgFileRevision is bright and shiny replacement
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Fri, 12 Aug 2011 18:58:16 +0200
parents 6e1373b54e9b
children 9ef71bd26db1
comparison
equal deleted inserted replaced
248:3fbfce107f94 249:4c3b9f679412
16 */ 16 */
17 package org.tmatesoft.hg.core; 17 package org.tmatesoft.hg.core;
18 18
19 import static org.tmatesoft.hg.repo.HgRepository.TIP; 19 import static org.tmatesoft.hg.repo.HgRepository.TIP;
20 20
21 import java.io.IOException;
22 import java.util.Calendar; 21 import java.util.Calendar;
23 import java.util.Collections; 22 import java.util.Collections;
24 import java.util.ConcurrentModificationException; 23 import java.util.ConcurrentModificationException;
25 import java.util.LinkedList; 24 import java.util.LinkedList;
26 import java.util.List; 25 import java.util.List;
29 28
30 import org.tmatesoft.hg.repo.HgChangelog; 29 import org.tmatesoft.hg.repo.HgChangelog;
31 import org.tmatesoft.hg.repo.HgChangelog.RawChangeset; 30 import org.tmatesoft.hg.repo.HgChangelog.RawChangeset;
32 import org.tmatesoft.hg.repo.HgDataFile; 31 import org.tmatesoft.hg.repo.HgDataFile;
33 import org.tmatesoft.hg.repo.HgRepository; 32 import org.tmatesoft.hg.repo.HgRepository;
34 import org.tmatesoft.hg.util.ByteChannel;
35 import org.tmatesoft.hg.util.CancelledException; 33 import org.tmatesoft.hg.util.CancelledException;
36 import org.tmatesoft.hg.util.Path; 34 import org.tmatesoft.hg.util.Path;
37 import org.tmatesoft.hg.util.ProgressSupport; 35 import org.tmatesoft.hg.util.ProgressSupport;
38 36
39 37
286 public interface Handler extends HgChangesetHandler { 284 public interface Handler extends HgChangesetHandler {
287 } 285 }
288 286
289 /** 287 /**
290 * When {@link HgLogCommand} is executed against file, handler passed to {@link HgLogCommand#execute(HgChangesetHandler)} may optionally 288 * When {@link HgLogCommand} is executed against file, handler passed to {@link HgLogCommand#execute(HgChangesetHandler)} may optionally
291 * implement this interface to get information about file renames. Method {@link #copy(FileRevision, FileRevision)} would 289 * implement this interface to get information about file renames. Method {@link #copy(HgFileRevision, HgFileRevision)} would
292 * get invoked prior any changeset of the original file (if file history being followed) is reported via {@link #next(HgChangeset)}. 290 * get invoked prior any changeset of the original file (if file history being followed) is reported via {@link #next(HgChangeset)}.
293 * 291 *
294 * For {@link HgLogCommand#file(Path, boolean)} with renamed file path and follow argument set to false, 292 * For {@link HgLogCommand#file(Path, boolean)} with renamed file path and follow argument set to false,
295 * {@link #copy(FileRevision, FileRevision)} would be invoked for the first copy/rename in the history of the file, but not 293 * {@link #copy(HgFileRevision, HgFileRevision)} would be invoked for the first copy/rename in the history of the file, but not
296 * followed by any changesets. 294 * followed by any changesets.
297 * 295 *
298 * @author Artem Tikhomirov 296 * @author Artem Tikhomirov
299 * @author TMate Software Ltd. 297 * @author TMate Software Ltd.
300 */ 298 */
301 public interface FileHistoryHandler extends HgChangesetHandler { 299 public interface FileHistoryHandler extends HgChangesetHandler {
302 // XXX perhaps, should distinguish copy from rename? And what about merged revisions and following them? 300 // XXX perhaps, should distinguish copy from rename? And what about merged revisions and following them?
303 void copy(FileRevision from, FileRevision to); 301 void copy(HgFileRevision from, HgFileRevision to);
304 } 302 }
305 303
306 public static class CollectHandler implements HgChangesetHandler { 304 public static class CollectHandler implements HgChangesetHandler {
307 private final List<HgChangeset> result = new LinkedList<HgChangeset>(); 305 private final List<HgChangeset> result = new LinkedList<HgChangeset>();
308 306
312 310
313 public void next(HgChangeset changeset) { 311 public void next(HgChangeset changeset) {
314 result.add(changeset.clone()); 312 result.add(changeset.clone());
315 } 313 }
316 } 314 }
317
318 /**
319 * @deprecated pulled up, use {@link HgFileRevision} instead.
320 */
321 @Deprecated
322 public interface FileRevision {
323 public abstract Path getPath();
324 public abstract Nodeid getRevision();
325 public abstract void putContentTo(ByteChannel sink) throws HgDataStreamException, CancelledException;
326 }
327 } 315 }