comparison src/org/tmatesoft/hg/core/ChangesetTransformer.java @ 432:1fc0da631200

Revlog.ParentWalker helper class got promoted as TLC, renamed to HgParentChildMap
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Fri, 30 Mar 2012 16:22:51 +0200
parents 12f668401613
children 1ee452f31187
comparison
equal deleted inserted replaced
431:12f668401613 432:1fc0da631200
21 import org.tmatesoft.hg.internal.PathPool; 21 import org.tmatesoft.hg.internal.PathPool;
22 import org.tmatesoft.hg.repo.HgChangelog; 22 import org.tmatesoft.hg.repo.HgChangelog;
23 import org.tmatesoft.hg.repo.HgChangelog.RawChangeset; 23 import org.tmatesoft.hg.repo.HgChangelog.RawChangeset;
24 import org.tmatesoft.hg.repo.HgRepository; 24 import org.tmatesoft.hg.repo.HgRepository;
25 import org.tmatesoft.hg.repo.HgStatusCollector; 25 import org.tmatesoft.hg.repo.HgStatusCollector;
26 import org.tmatesoft.hg.repo.HgParentChildMap;
26 import org.tmatesoft.hg.util.Adaptable; 27 import org.tmatesoft.hg.util.Adaptable;
27 import org.tmatesoft.hg.util.CancelSupport; 28 import org.tmatesoft.hg.util.CancelSupport;
28 import org.tmatesoft.hg.util.CancelledException; 29 import org.tmatesoft.hg.util.CancelledException;
29 import org.tmatesoft.hg.util.PathRewrite; 30 import org.tmatesoft.hg.util.PathRewrite;
30 import org.tmatesoft.hg.util.ProgressSupport; 31 import org.tmatesoft.hg.util.ProgressSupport;
45 private HgCallbackTargetException failure; 46 private HgCallbackTargetException failure;
46 private CancelledException cancellation; 47 private CancelledException cancellation;
47 48
48 // repo and delegate can't be null, parent walker can 49 // repo and delegate can't be null, parent walker can
49 // ps and cs can't be null 50 // ps and cs can't be null
50 public ChangesetTransformer(HgRepository hgRepo, HgChangesetHandler delegate, HgChangelog.ParentWalker pw, ProgressSupport ps, CancelSupport cs) { 51 public ChangesetTransformer(HgRepository hgRepo, HgChangesetHandler delegate, HgParentChildMap<HgChangelog> pw, ProgressSupport ps, CancelSupport cs) {
51 if (hgRepo == null || delegate == null) { 52 if (hgRepo == null || delegate == null) {
52 throw new IllegalArgumentException(); 53 throw new IllegalArgumentException();
53 } 54 }
54 if (ps == null || cs == null) { 55 if (ps == null || cs == null) {
55 throw new IllegalArgumentException(); 56 throw new IllegalArgumentException();
99 100
100 // part relevant to RawChangeset->HgChangeset transformation 101 // part relevant to RawChangeset->HgChangeset transformation
101 static class Transformation { 102 static class Transformation {
102 private final HgChangeset changeset; 103 private final HgChangeset changeset;
103 104
104 public Transformation(HgStatusCollector statusCollector, HgChangelog.ParentWalker pw) { 105 public Transformation(HgStatusCollector statusCollector, HgParentChildMap<HgChangelog> pw) {
105 // files listed in a changeset don't need their names to be rewritten (they are normalized already) 106 // files listed in a changeset don't need their names to be rewritten (they are normalized already)
106 // pp serves as a cache for all filenames encountered and as a source for Path listed in the changeset 107 // pp serves as a cache for all filenames encountered and as a source for Path listed in the changeset
107 PathPool pp = new PathPool(new PathRewrite.Empty()); 108 PathPool pp = new PathPool(new PathRewrite.Empty());
108 statusCollector.setPathPool(pp); 109 statusCollector.setPathPool(pp);
109 changeset = new HgChangeset(statusCollector, pp); 110 changeset = new HgChangeset(statusCollector, pp);