comparison src/org/tmatesoft/hg/repo/HgMergeState.java @ 431:12f668401613

FIXMEs: awkward API refactored, what need to be internal got hidden; public aspects got captured in slim interfaces
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Thu, 29 Mar 2012 20:54:04 +0200
parents 9c9c442b5f2e
children b3c16d1aede0
comparison
equal deleted inserted replaced
430:d280759c2a3f 431:12f668401613
31 import org.tmatesoft.hg.core.Nodeid; 31 import org.tmatesoft.hg.core.Nodeid;
32 import org.tmatesoft.hg.internal.ManifestRevision; 32 import org.tmatesoft.hg.internal.ManifestRevision;
33 import org.tmatesoft.hg.internal.Pool; 33 import org.tmatesoft.hg.internal.Pool;
34 import org.tmatesoft.hg.util.Pair; 34 import org.tmatesoft.hg.util.Pair;
35 import org.tmatesoft.hg.util.Path; 35 import org.tmatesoft.hg.util.Path;
36 import org.tmatesoft.hg.util.PathPool;
37 import org.tmatesoft.hg.util.PathRewrite; 36 import org.tmatesoft.hg.util.PathRewrite;
38 37
39 /** 38 /**
40 * Access to repository's merge state 39 * Access to repository's merge state
41 * 40 *
109 // empty state 108 // empty state
110 return; 109 return;
111 } 110 }
112 try { 111 try {
113 ArrayList<Entry> result = new ArrayList<Entry>(); 112 ArrayList<Entry> result = new ArrayList<Entry>();
114 // FIXME need to settle use of Pool<Path> and PathPool 113 // pipe (already normalized) names from mergestate through same pool of filenames as use manifest revisions
115 // latter is pool that can create objects on demand, former is just cache 114 Path.Source pathPool = new Path.SimpleSource(new PathRewrite.Empty(), fnamePool);
116 PathPool pathPool = new PathPool(new PathRewrite.Empty());
117 final ManifestRevision m1 = new ManifestRevision(nodeidPool, fnamePool); 115 final ManifestRevision m1 = new ManifestRevision(nodeidPool, fnamePool);
118 final ManifestRevision m2 = new ManifestRevision(nodeidPool, fnamePool); 116 final ManifestRevision m2 = new ManifestRevision(nodeidPool, fnamePool);
119 if (!wcp2.isNull()) { 117 if (!wcp2.isNull()) {
120 final int rp2 = repo.getChangelog().getRevisionIndex(wcp2); 118 final int rp2 = repo.getChangelog().getRevisionIndex(wcp2);
121 repo.getManifest().walk(rp2, rp2, m2); 119 repo.getManifest().walk(rp2, rp2, m2);
161 Entry e = new Entry(k, pathPool.path(r[0]), p1, p2, ca); 159 Entry e = new Entry(k, pathPool.path(r[0]), p1, p2, ca);
162 result.add(e); 160 result.add(e);
163 } 161 }
164 entries = result.toArray(new Entry[result.size()]); 162 entries = result.toArray(new Entry[result.size()]);
165 br.close(); 163 br.close();
166 pathPool.clear();
167 } catch (IOException ex) { 164 } catch (IOException ex) {
168 throw new HgInvalidControlFileException("Merge state read failed", ex, f); 165 throw new HgInvalidControlFileException("Merge state read failed", ex, f);
169 } 166 }
170 } 167 }
171 168