Mercurial > jhg
comparison src/org/tmatesoft/hg/repo/HgWorkingCopyStatusCollector.java @ 350:33eaed1ad130
Allow FileIterator report any errors from the underlaying file system up to the client
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Tue, 29 Nov 2011 03:46:17 +0100 |
parents | a0864b2892cd |
children | 5f9073eabf06 |
comparison
equal
deleted
inserted
replaced
349:bba9f52cacf3 | 350:33eaed1ad130 |
---|---|
139 return dirstateParentManifest; | 139 return dirstateParentManifest; |
140 } | 140 } |
141 | 141 |
142 // may be invoked few times, TIP or WORKING_COPY indicate comparison shall be run against working copy parent | 142 // may be invoked few times, TIP or WORKING_COPY indicate comparison shall be run against working copy parent |
143 // NOTE, use of TIP constant requires certain care. TIP here doesn't mean latest cset, but actual working copy parent. | 143 // NOTE, use of TIP constant requires certain care. TIP here doesn't mean latest cset, but actual working copy parent. |
144 public void walk(int baseRevision, HgStatusInspector inspector) { | 144 public void walk(int baseRevision, HgStatusInspector inspector) throws IOException { |
145 if (HgInternals.wrongLocalRevision(baseRevision) || baseRevision == BAD_REVISION) { | 145 if (HgInternals.wrongLocalRevision(baseRevision) || baseRevision == BAD_REVISION) { |
146 throw new IllegalArgumentException(String.valueOf(baseRevision)); | 146 throw new IllegalArgumentException(String.valueOf(baseRevision)); |
147 } | 147 } |
148 if (getDirstateImpl() == null) { | 148 if (getDirstateImpl() == null) { |
149 // XXX this is a hack to avoid declaring throws for the #walk() at the moment | 149 // XXX this is a hack to avoid declaring throws for the #walk() at the moment |
264 } | 264 } |
265 } | 265 } |
266 } | 266 } |
267 } | 267 } |
268 | 268 |
269 public HgStatusCollector.Record status(int baseRevision) { | 269 public HgStatusCollector.Record status(int baseRevision) throws IOException { |
270 HgStatusCollector.Record rv = new HgStatusCollector.Record(); | 270 HgStatusCollector.Record rv = new HgStatusCollector.Record(); |
271 walk(baseRevision, rv); | 271 walk(baseRevision, rv); |
272 return rv; | 272 return rv; |
273 } | 273 } |
274 | 274 |
605 assert filterMatcher != null; | 605 assert filterMatcher != null; |
606 filter = filterMatcher; | 606 filter = filterMatcher; |
607 walker = fileWalker; | 607 walker = fileWalker; |
608 } | 608 } |
609 | 609 |
610 public void reset() { | 610 public void reset() throws IOException { |
611 walker.reset(); | 611 walker.reset(); |
612 } | 612 } |
613 | 613 |
614 public boolean hasNext() { | 614 public boolean hasNext() throws IOException { |
615 while (walker.hasNext()) { | 615 while (walker.hasNext()) { |
616 walker.next(); | 616 walker.next(); |
617 if (filter.accept(walker.name())) { | 617 if (filter.accept(walker.name())) { |
618 didNext = true; | 618 didNext = true; |
619 return true; | 619 return true; |
620 } | 620 } |
621 } | 621 } |
622 return false; | 622 return false; |
623 } | 623 } |
624 | 624 |
625 public void next() { | 625 public void next() throws IOException { |
626 if (didNext) { | 626 if (didNext) { |
627 didNext = false; | 627 didNext = false; |
628 } else { | 628 } else { |
629 if (!hasNext()) { | 629 if (!hasNext()) { |
630 throw new NoSuchElementException(); | 630 throw new NoSuchElementException(); |