Mercurial > jhg
comparison src/org/tmatesoft/hg/core/HgCheckoutCommand.java @ 572:becd2a1310a2
Report file object in case of error to be helpful as much as possible
| author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
|---|---|
| date | Fri, 12 Apr 2013 18:30:55 +0200 |
| parents | 78a9e26e670d |
| children | bd5926e24aa3 |
comparison
equal
deleted
inserted
replaced
| 571:e4ee4bf4c7d0 | 572:becd2a1310a2 |
|---|---|
| 189 CheckoutWorker(Internals implRepo) { | 189 CheckoutWorker(Internals implRepo) { |
| 190 hgRepo = implRepo; | 190 hgRepo = implRepo; |
| 191 } | 191 } |
| 192 | 192 |
| 193 public boolean next(Nodeid nid, Path fname, Flags flags) { | 193 public boolean next(Nodeid nid, Path fname, Flags flags) { |
| 194 WorkingDirFileWriter workingDirWriter = null; | |
| 194 try { | 195 try { |
| 195 HgDataFile df = hgRepo.getRepo().getFileNode(fname); | 196 HgDataFile df = hgRepo.getRepo().getFileNode(fname); |
| 196 int fileRevIndex = df.getRevisionIndex(nid); | 197 int fileRevIndex = df.getRevisionIndex(nid); |
| 197 // check out files based on manifest | 198 // check out files based on manifest |
| 198 // FIXME links! | 199 // FIXME links! |
| 199 WorkingDirFileWriter workingDirWriter = new WorkingDirFileWriter(hgRepo); | 200 workingDirWriter = new WorkingDirFileWriter(hgRepo); |
| 200 workingDirWriter.processFile(df, fileRevIndex); | 201 workingDirWriter.processFile(df, fileRevIndex); |
| 201 lastWrittenFileSize = workingDirWriter.bytesWritten(); | 202 lastWrittenFileSize = workingDirWriter.bytesWritten(); |
| 202 return true; | 203 return true; |
| 203 } catch (IOException ex) { | 204 } catch (IOException ex) { |
| 204 failure = new HgIOException("Failed to write down file revision", ex, /*FIXME file*/null); | 205 failure = new HgIOException("Failed to write down file revision", ex, workingDirWriter.getDestinationFile()); |
| 205 } catch (HgRuntimeException ex) { | 206 } catch (HgRuntimeException ex) { |
| 206 failure = new HgLibraryFailureException(ex); | 207 failure = new HgLibraryFailureException(ex); |
| 207 } | 208 } |
| 208 return false; | 209 return false; |
| 209 } | 210 } |
