comparison src/org/tmatesoft/hg/repo/HgWorkingCopyStatusCollector.java @ 360:150500515714

Report non-critical errors during status operation to handler/inspector
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Thu, 08 Dec 2011 22:19:27 +0100
parents 91d75e1bac9f
children 4937e35b805b
comparison
equal deleted inserted replaced
359:1d9bcab9c50f 360:150500515714
147 if (HgInternals.wrongLocalRevision(baseRevision) || baseRevision == BAD_REVISION) { 147 if (HgInternals.wrongLocalRevision(baseRevision) || baseRevision == BAD_REVISION) {
148 throw new IllegalArgumentException(String.valueOf(baseRevision)); 148 throw new IllegalArgumentException(String.valueOf(baseRevision));
149 } 149 }
150 try { 150 try {
151 if (getDirstateImpl() == null) { 151 if (getDirstateImpl() == null) {
152 // XXX this is a hack to avoid declaring throws for the #walk() at the moment 152 // FIXME this is a hack to avoid declaring throws for the #walk() at the moment
153 // once I decide whether to have mediator that collects errors or to use exceptions here 153 // once I decide whether to have mediator that collects errors or to use exceptions here
154 // this hack shall be removed in favor of either severe error in mediator or a re-thrown exception. 154 // this hack shall be removed in favor of either severe error in mediator or a re-thrown exception.
155 getDirstate(); 155 getDirstate();
156 } 156 }
157 if (getDirstateParentManifest() == null) { 157 if (getDirstateParentManifest() == null) {
337 if (origin != null) { 337 if (origin != null) {
338 inspector.copied(getPathPool().path(origin), fname); 338 inspector.copied(getPathPool().path(origin), fname);
339 return; 339 return;
340 } 340 }
341 } catch (HgException ex) { 341 } catch (HgException ex) {
342 ex.printStackTrace(); 342 // report failure and continue status collection
343 // FIXME report to a mediator, continue status collection 343 inspector.invalid(fname, ex);
344 } 344 }
345 } else if ((r = getDirstateImpl().checkAdded(fname)) != null) { 345 } else if ((r = getDirstateImpl().checkAdded(fname)) != null) {
346 if (r.copySource() != null && baseRevNames.contains(r.copySource())) { 346 if (r.copySource() != null && baseRevNames.contains(r.copySource())) {
347 baseRevNames.remove(r.copySource()); // XXX surely I shall not report rename source as Removed? 347 baseRevNames.remove(r.copySource()); // XXX surely I shall not report rename source as Removed?
348 inspector.copied(r.copySource(), fname); 348 inspector.copied(r.copySource(), fname);