comparison src/org/tmatesoft/hg/repo/HgManifest.java @ 320:678e326fd27c

Issue 15: Exception accessing oddly named file from history
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Fri, 30 Sep 2011 06:22:11 +0200
parents c1e3c18fd2f2
children ac38e75c9e8e
comparison
equal deleted inserted replaced
319:fa4aea41746e 320:678e326fd27c
18 18
19 import static org.tmatesoft.hg.repo.HgRepository.TIP; 19 import static org.tmatesoft.hg.repo.HgRepository.TIP;
20 20
21 import java.io.ByteArrayOutputStream; 21 import java.io.ByteArrayOutputStream;
22 import java.io.IOException; 22 import java.io.IOException;
23 import java.nio.charset.Charset;
23 import java.util.ArrayList; 24 import java.util.ArrayList;
24 import java.util.Arrays; 25 import java.util.Arrays;
25 26
26 import org.tmatesoft.hg.core.HgBadStateException; 27 import org.tmatesoft.hg.core.HgBadStateException;
27 import org.tmatesoft.hg.core.Nodeid; 28 import org.tmatesoft.hg.core.Nodeid;
28 import org.tmatesoft.hg.internal.DataAccess; 29 import org.tmatesoft.hg.internal.DataAccess;
29 import org.tmatesoft.hg.internal.DigestHelper; 30 import org.tmatesoft.hg.internal.DigestHelper;
31 import org.tmatesoft.hg.internal.EncodingHelper;
30 import org.tmatesoft.hg.internal.Experimental; 32 import org.tmatesoft.hg.internal.Experimental;
31 import org.tmatesoft.hg.internal.IterateControlMediator; 33 import org.tmatesoft.hg.internal.IterateControlMediator;
32 import org.tmatesoft.hg.internal.Lifecycle; 34 import org.tmatesoft.hg.internal.Lifecycle;
33 import org.tmatesoft.hg.internal.Pool2; 35 import org.tmatesoft.hg.internal.Pool2;
34 import org.tmatesoft.hg.internal.RevlogStream; 36 import org.tmatesoft.hg.internal.RevlogStream;
266 return hash; 268 return hash;
267 } 269 }
268 270
269 public Path freeze() { 271 public Path freeze() {
270 if (result == null) { 272 if (result == null) {
271 result = Path.create(new String(data, start, length)); 273 result = Path.create(EncodingHelper.fromManifest(data, start, length));
272 // release reference to bigger data array, make a copy of relevant part only 274 // release reference to bigger data array, make a copy of relevant part only
273 // use original bytes, not those from String above to avoid cache misses due to different encodings 275 // use original bytes, not those from String above to avoid cache misses due to different encodings
274 byte[] d = new byte[length]; 276 byte[] d = new byte[length];
275 System.arraycopy(data, start, d, 0, length); 277 System.arraycopy(data, start, d, 0, length);
276 data = d; 278 data = d;