comparison src/org/tmatesoft/hg/internal/FileAnnotation.java @ 630:72c979555cb8

HgDiffCommand. Do not use deprecated code. Javadoc
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Thu, 23 May 2013 19:44:28 +0200
parents 5f52074707b2
children cce0387c6041
comparison
equal deleted inserted replaced
629:5f52074707b2 630:72c979555cb8
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;
21 import org.tmatesoft.hg.core.HgIterateDirection;
22 import org.tmatesoft.hg.core.HgBlameInspector; 20 import org.tmatesoft.hg.core.HgBlameInspector;
23 import org.tmatesoft.hg.core.HgBlameInspector.RevisionDescriptor; 21 import org.tmatesoft.hg.core.HgBlameInspector.RevisionDescriptor;
24 import org.tmatesoft.hg.repo.HgDataFile;
25 import org.tmatesoft.hg.repo.HgInvalidStateException; 22 import org.tmatesoft.hg.repo.HgInvalidStateException;
26 import org.tmatesoft.hg.repo.HgRuntimeException;
27 23
28 /** 24 /**
29 * Produce output like 'hg annotate' does 25 * Produce output like 'hg annotate' does
30 * 26 *
31 * @author Artem Tikhomirov 27 * @author Artem Tikhomirov
42 void line(int lineNumber, int changesetRevIndex, BlockData lineContent, LineDescriptor ld); 38 void line(int lineNumber, int changesetRevIndex, BlockData lineContent, LineDescriptor ld);
43 } 39 }
44 40
45 public interface LineDescriptor { 41 public interface LineDescriptor {
46 int totalLines(); 42 int totalLines();
47 }
48
49 /**
50 * Annotate file revision, line by line.
51 */
52 public static void annotate(HgDataFile df, int changelogRevisionIndex, LineInspector insp) throws HgCallbackTargetException, HgRuntimeException {
53 if (!df.exists()) {
54 return;
55 }
56 FileAnnotation fa = new FileAnnotation(insp);
57 df.annotate(0, changelogRevisionIndex, fa, HgIterateDirection.NewToOld);
58 } 43 }
59 44
60 // keeps <startSeq1, startSeq2, len> of equal blocks, origin to target, from some previous step 45 // keeps <startSeq1, startSeq2, len> of equal blocks, origin to target, from some previous step
61 private RangeSeq activeEquals; 46 private RangeSeq activeEquals;
62 // equal blocks of the current iteration, to be recalculated before next step 47 // equal blocks of the current iteration, to be recalculated before next step