comparison src/org/tmatesoft/hg/repo/HgStatusCollector.java @ 425:48f993aa2f41

FIXMEs: exceptions, javadoc
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Wed, 28 Mar 2012 18:39:29 +0200
parents 6437d261048a
children 12f668401613
comparison
equal deleted inserted replaced
424:6437d261048a 425:48f993aa2f41
24 import java.util.LinkedList; 24 import java.util.LinkedList;
25 import java.util.List; 25 import java.util.List;
26 import java.util.Map; 26 import java.util.Map;
27 import java.util.TreeSet; 27 import java.util.TreeSet;
28 28
29 import org.tmatesoft.hg.core.HgException;
30 import org.tmatesoft.hg.core.Nodeid; 29 import org.tmatesoft.hg.core.Nodeid;
31 import org.tmatesoft.hg.internal.IntMap; 30 import org.tmatesoft.hg.internal.IntMap;
32 import org.tmatesoft.hg.internal.ManifestRevision; 31 import org.tmatesoft.hg.internal.ManifestRevision;
33 import org.tmatesoft.hg.internal.Pool; 32 import org.tmatesoft.hg.internal.Pool;
34 import org.tmatesoft.hg.util.CancelSupport; 33 import org.tmatesoft.hg.util.CancelSupport;
296 if (copyOrigin != null) { 295 if (copyOrigin != null) {
297 inspector.copied(getPathPool().path(copyOrigin) /*pipe through pool, just in case*/, copyTarget); 296 inspector.copied(getPathPool().path(copyOrigin) /*pipe through pool, just in case*/, copyTarget);
298 } else { 297 } else {
299 inspector.added(copyTarget); 298 inspector.added(copyTarget);
300 } 299 }
301 } catch (HgException ex) { 300 } catch (HgInvalidFileException ex) {
302 // record exception to a mediator and continue, 301 // record exception to a mediator and continue,
303 // for a single file not to be irresolvable obstacle for a status operation 302 // for a single file not to be irresolvable obstacle for a status operation
304 inspector.invalid(r2fname, ex); 303 inspector.invalid(r2fname, ex);
305 } 304 }
306 cs.checkCancelled(); 305 cs.checkCancelled();
333 throw t; 332 throw t;
334 } 333 }
335 return rv; 334 return rv;
336 } 335 }
337 336
338 /*package-local*/static Path getOriginIfCopy(HgRepository hgRepo, Path fname, Collection<Path> originals, int originalChangelogRevision) throws HgException { 337 /*package-local*/static Path getOriginIfCopy(HgRepository hgRepo, Path fname, Collection<Path> originals, int originalChangelogRevision) throws HgInvalidFileException {
339 HgDataFile df = hgRepo.getFileNode(fname); 338 HgDataFile df = hgRepo.getFileNode(fname);
340 if (!df.exists()) { 339 if (!df.exists()) {
341 String msg = String.format("Didn't find file '%s' in the repo. Perhaps, bad storage name conversion?", fname); 340 String msg = String.format("Didn't find file '%s' in the repo. Perhaps, bad storage name conversion?", fname);
342 throw new HgException(msg).setFileName(fname).setRevisionIndex(originalChangelogRevision); 341 throw new HgInvalidFileException(msg, null).setFileName(fname).setRevisionIndex(originalChangelogRevision);
343 } 342 }
344 while (df.isCopy()) { 343 while (df.isCopy()) {
345 Path original = df.getCopySourceName(); 344 Path original = df.getCopySourceName();
346 if (originals.contains(original)) { 345 if (originals.contains(original)) {
347 df = hgRepo.getFileNode(original); 346 df = hgRepo.getFileNode(original);