Mercurial > jhg
comparison src/org/tmatesoft/hg/internal/FileAnnotation.java @ 562:6fbca6506bb5
Allow HgBlameFacility.Inspector (former BlockInspector) to throw an exception
| author | Artem Tikhomirov <tikhomirov.artem@gmail.com> | 
|---|---|
| date | Thu, 28 Feb 2013 15:57:04 +0100 | 
| parents | 52263817b998 | 
| children | 8ed4f4f4f0a6 | 
   comparison
  equal
  deleted
  inserted
  replaced
| 561:d3c71498919c | 562:6fbca6506bb5 | 
|---|---|
| 15 * contact TMate Software at support@hg4j.com | 15 * contact TMate Software at support@hg4j.com | 
| 16 */ | 16 */ | 
| 17 package org.tmatesoft.hg.internal; | 17 package org.tmatesoft.hg.internal; | 
| 18 | 18 | 
| 19 | 19 | 
| 20 import org.tmatesoft.hg.core.HgCallbackTargetException; | |
| 20 import org.tmatesoft.hg.core.HgIterateDirection; | 21 import org.tmatesoft.hg.core.HgIterateDirection; | 
| 21 import org.tmatesoft.hg.repo.HgBlameFacility; | 22 import org.tmatesoft.hg.repo.HgBlameFacility; | 
| 22 import org.tmatesoft.hg.repo.HgInvalidStateException; | 23 import org.tmatesoft.hg.repo.HgInvalidStateException; | 
| 23 import org.tmatesoft.hg.repo.HgBlameFacility.AddBlock; | 24 import org.tmatesoft.hg.repo.HgBlameFacility.AddBlock; | 
| 24 import org.tmatesoft.hg.repo.HgBlameFacility.BlockData; | 25 import org.tmatesoft.hg.repo.HgBlameFacility.BlockData; | 
| 32 * Produce output like 'hg annotate' does | 33 * Produce output like 'hg annotate' does | 
| 33 * | 34 * | 
| 34 * @author Artem Tikhomirov | 35 * @author Artem Tikhomirov | 
| 35 * @author TMate Software Ltd. | 36 * @author TMate Software Ltd. | 
| 36 */ | 37 */ | 
| 37 public class FileAnnotation implements HgBlameFacility.BlockInspector, RevisionDescriptor.Recipient { | 38 public class FileAnnotation implements HgBlameFacility.Inspector, RevisionDescriptor.Recipient { | 
| 38 | 39 | 
| 39 @Experimental(reason="The line-by-line inspector likely to become part of core/command API") | 40 @Experimental(reason="The line-by-line inspector likely to become part of core/command API") | 
| 40 @Callback | 41 @Callback | 
| 41 public interface LineInspector { | 42 public interface LineInspector { | 
| 42 /** | 43 /** | 
| 50 } | 51 } | 
| 51 | 52 | 
| 52 /** | 53 /** | 
| 53 * Annotate file revision, line by line. | 54 * Annotate file revision, line by line. | 
| 54 */ | 55 */ | 
| 55 public static void annotate(HgDataFile df, int changelogRevisionIndex, LineInspector insp) { | 56 public static void annotate(HgDataFile df, int changelogRevisionIndex, LineInspector insp) throws HgCallbackTargetException { | 
| 56 if (!df.exists()) { | 57 if (!df.exists()) { | 
| 57 return; | 58 return; | 
| 58 } | 59 } | 
| 59 FileAnnotation fa = new FileAnnotation(insp); | 60 FileAnnotation fa = new FileAnnotation(insp); | 
| 60 HgBlameFacility af = new HgBlameFacility(); | 61 HgBlameFacility af = new HgBlameFacility(); | 
