Mercurial > jhg
comparison src/org/tmatesoft/hg/internal/FileAnnotation.java @ 556:e55f17a7a195
AnnotateFacility renamed to HgBlameFacility and exposed, API shapes out and got some javadoc
| author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
|---|---|
| date | Fri, 22 Feb 2013 20:21:24 +0100 |
| parents | e623aa2ca526 |
| children | b9e5ac26dd83 |
comparison
equal
deleted
inserted
replaced
| 555:e623aa2ca526 | 556:e55f17a7a195 |
|---|---|
| 17 package org.tmatesoft.hg.internal; | 17 package org.tmatesoft.hg.internal; |
| 18 | 18 |
| 19 import java.util.LinkedList; | 19 import java.util.LinkedList; |
| 20 | 20 |
| 21 import org.tmatesoft.hg.core.HgIterateDirection; | 21 import org.tmatesoft.hg.core.HgIterateDirection; |
| 22 import org.tmatesoft.hg.internal.AnnotateFacility.*; | 22 import org.tmatesoft.hg.repo.HgBlameFacility; |
| 23 import org.tmatesoft.hg.repo.HgDataFile; | 23 import org.tmatesoft.hg.repo.HgDataFile; |
| 24 import org.tmatesoft.hg.repo.HgBlameFacility.*; | |
| 24 | 25 |
| 25 /** | 26 /** |
| 26 * Produce output like 'hg annotate' does | 27 * Produce output like 'hg annotate' does |
| 27 * | 28 * |
| 28 * @author Artem Tikhomirov | 29 * @author Artem Tikhomirov |
| 29 * @author TMate Software Ltd. | 30 * @author TMate Software Ltd. |
| 30 */ | 31 */ |
| 31 public class FileAnnotation implements AnnotateFacility.BlockInspector, RevisionDescriptor.Recipient { | 32 public class FileAnnotation implements HgBlameFacility.BlockInspector, RevisionDescriptor.Recipient { |
| 32 | 33 |
| 33 @Experimental(reason="The line-by-line inspector likely to become part of core/command API") | 34 @Experimental(reason="The line-by-line inspector likely to become part of core/command API") |
| 34 @Callback | 35 @Callback |
| 35 public interface LineInspector { | 36 public interface LineInspector { |
| 36 /** | 37 /** |
| 49 public static void annotate(HgDataFile df, int changelogRevisionIndex, LineInspector insp) { | 50 public static void annotate(HgDataFile df, int changelogRevisionIndex, LineInspector insp) { |
| 50 if (!df.exists()) { | 51 if (!df.exists()) { |
| 51 return; | 52 return; |
| 52 } | 53 } |
| 53 FileAnnotation fa = new FileAnnotation(insp); | 54 FileAnnotation fa = new FileAnnotation(insp); |
| 54 AnnotateFacility af = new AnnotateFacility(); | 55 HgBlameFacility af = new HgBlameFacility(); |
| 55 af.annotate(df, changelogRevisionIndex, fa, HgIterateDirection.NewToOld); | 56 af.annotate(df, changelogRevisionIndex, fa, HgIterateDirection.NewToOld); |
| 56 } | 57 } |
| 57 | 58 |
| 58 // blocks deleted in the target, as reported at the previous step | 59 // blocks deleted in the target, as reported at the previous step |
| 59 private LinkedList<DeleteBlock> deleted = new LinkedList<DeleteBlock>(); | 60 private LinkedList<DeleteBlock> deleted = new LinkedList<DeleteBlock>(); |
