Mercurial > jhg
comparison src/org/tmatesoft/hg/repo/HgStatusCollector.java @ 354:5f9073eabf06
Propagate errors with exceptions up to a end client
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Thu, 01 Dec 2011 05:21:40 +0100 |
parents | 678e326fd27c |
children | 150500515714 |
comparison
equal
deleted
inserted
replaced
353:0f3687e79f5a | 354:5f9073eabf06 |
---|---|
27 import java.util.Map; | 27 import java.util.Map; |
28 import java.util.TreeSet; | 28 import java.util.TreeSet; |
29 | 29 |
30 import org.tmatesoft.hg.core.HgBadStateException; | 30 import org.tmatesoft.hg.core.HgBadStateException; |
31 import org.tmatesoft.hg.core.HgDataStreamException; | 31 import org.tmatesoft.hg.core.HgDataStreamException; |
32 import org.tmatesoft.hg.core.HgException; | |
33 import org.tmatesoft.hg.core.HgInvalidControlFileException; | |
32 import org.tmatesoft.hg.core.Nodeid; | 34 import org.tmatesoft.hg.core.Nodeid; |
33 import org.tmatesoft.hg.internal.IntMap; | 35 import org.tmatesoft.hg.internal.IntMap; |
34 import org.tmatesoft.hg.internal.ManifestRevision; | 36 import org.tmatesoft.hg.internal.ManifestRevision; |
35 import org.tmatesoft.hg.internal.Pool; | 37 import org.tmatesoft.hg.internal.Pool; |
36 import org.tmatesoft.hg.util.Path; | 38 import org.tmatesoft.hg.util.Path; |
266 if (copyOrigin != null) { | 268 if (copyOrigin != null) { |
267 inspector.copied(getPathPool().path(copyOrigin) /*pipe through pool, just in case*/, copyTarget); | 269 inspector.copied(getPathPool().path(copyOrigin) /*pipe through pool, just in case*/, copyTarget); |
268 } else { | 270 } else { |
269 inspector.added(copyTarget); | 271 inspector.added(copyTarget); |
270 } | 272 } |
271 } catch (HgDataStreamException ex) { | 273 } catch (HgException ex) { |
272 ex.printStackTrace(); | 274 ex.printStackTrace(); |
273 // FIXME perhaps, shall record this exception to dedicated mediator and continue | 275 // FIXME perhaps, shall record this exception to dedicated mediator and continue |
274 // for a single file not to be irresolvable obstacle for a status operation | 276 // for a single file not to be irresolvable obstacle for a status operation |
275 } | 277 } |
276 } | 278 } |
286 Record rv = new Record(); | 288 Record rv = new Record(); |
287 walk(rev1, rev2, rv); | 289 walk(rev1, rev2, rv); |
288 return rv; | 290 return rv; |
289 } | 291 } |
290 | 292 |
291 /*package-local*/static Path getOriginIfCopy(HgRepository hgRepo, Path fname, Collection<Path> originals, int originalChangelogRevision) throws HgDataStreamException { | 293 /*package-local*/static Path getOriginIfCopy(HgRepository hgRepo, Path fname, Collection<Path> originals, int originalChangelogRevision) throws HgDataStreamException, HgInvalidControlFileException { |
292 HgDataFile df = hgRepo.getFileNode(fname); | 294 HgDataFile df = hgRepo.getFileNode(fname); |
293 if (!df.exists()) { | 295 if (!df.exists()) { |
294 String msg = String.format("Didn't find file '%s' in the repo. Perhaps, bad storage name conversion?", fname); | 296 String msg = String.format("Didn't find file '%s' in the repo. Perhaps, bad storage name conversion?", fname); |
295 throw new HgDataStreamException(fname, msg, null).setRevisionNumber(originalChangelogRevision); | 297 throw new HgDataStreamException(fname, msg, null).setRevisionNumber(originalChangelogRevision); |
296 } | 298 } |