comparison src/org/tmatesoft/hg/core/HgAnnotateCommand.java @ 603:707b5c7c6fa4

Refactor HgBlameFacility: relevant action methods moved to proper home (HgDataFile), as facility doesn't provide anything but packaging of relevant methods/interfaces
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Mon, 06 May 2013 18:29:57 +0200
parents 73c20c648c1f
children f41dd9a3b8af
comparison
equal deleted inserted replaced
602:e3717fc7d26f 603:707b5c7c6fa4
24 import org.tmatesoft.hg.internal.CsetParamKeeper; 24 import org.tmatesoft.hg.internal.CsetParamKeeper;
25 import org.tmatesoft.hg.internal.Experimental; 25 import org.tmatesoft.hg.internal.Experimental;
26 import org.tmatesoft.hg.internal.FileAnnotation; 26 import org.tmatesoft.hg.internal.FileAnnotation;
27 import org.tmatesoft.hg.internal.FileAnnotation.LineDescriptor; 27 import org.tmatesoft.hg.internal.FileAnnotation.LineDescriptor;
28 import org.tmatesoft.hg.internal.FileAnnotation.LineInspector; 28 import org.tmatesoft.hg.internal.FileAnnotation.LineInspector;
29 import org.tmatesoft.hg.repo.HgBlameFacility.BlockData; 29 import org.tmatesoft.hg.repo.HgBlameInspector.BlockData;
30 import org.tmatesoft.hg.repo.HgBlameFacility;
31 import org.tmatesoft.hg.repo.HgDataFile; 30 import org.tmatesoft.hg.repo.HgDataFile;
32 import org.tmatesoft.hg.repo.HgRepository; 31 import org.tmatesoft.hg.repo.HgRepository;
33 import org.tmatesoft.hg.util.CancelSupport; 32 import org.tmatesoft.hg.util.CancelSupport;
34 import org.tmatesoft.hg.util.CancelledException; 33 import org.tmatesoft.hg.util.CancelledException;
35 import org.tmatesoft.hg.util.Path; 34 import org.tmatesoft.hg.util.Path;
40 * 39 *
41 * 'hg annotate' counterpart, report origin revision and file line-by-line 40 * 'hg annotate' counterpart, report origin revision and file line-by-line
42 * 41 *
43 * @author Artem Tikhomirov 42 * @author Artem Tikhomirov
44 * @author TMate Software Ltd. 43 * @author TMate Software Ltd.
44 * @since 1.1
45 */ 45 */
46 @Experimental(reason="Work in progress. Unstable API") 46 @Experimental(reason="Work in progress. Unstable API")
47 public class HgAnnotateCommand extends HgAbstractCommand<HgAnnotateCommand> { 47 public class HgAnnotateCommand extends HgAbstractCommand<HgAnnotateCommand> {
48 48
49 private final HgRepository repo; 49 private final HgRepository repo;
116 return; 116 return;
117 } 117 }
118 final int changesetStart = followRename ? 0 : df.getChangesetRevisionIndex(0); 118 final int changesetStart = followRename ? 0 : df.getChangesetRevisionIndex(0);
119 Collector c = new Collector(cancellation); 119 Collector c = new Collector(cancellation);
120 FileAnnotation fa = new FileAnnotation(c); 120 FileAnnotation fa = new FileAnnotation(c);
121 HgBlameFacility af = new HgBlameFacility(df); 121 df.annotate(changesetStart, annotateRevision.get(), fa, HgIterateDirection.NewToOld);
122 af.annotate(changesetStart, annotateRevision.get(), fa, HgIterateDirection.NewToOld);
123 progress.worked(1); 122 progress.worked(1);
124 c.throwIfCancelled(); 123 c.throwIfCancelled();
125 cancellation.checkCancelled(); 124 cancellation.checkCancelled();
126 ProgressSupport.Sub subProgress = new ProgressSupport.Sub(progress, 1); 125 ProgressSupport.Sub subProgress = new ProgressSupport.Sub(progress, 1);
127 subProgress.start(c.lineRevisions.length); 126 subProgress.start(c.lineRevisions.length);