# HG changeset patch # User Artem Tikhomirov # Date 1365784255 -7200 # Node ID becd2a1310a2a97f5270d651b27bb42197070684 # Parent e4ee4bf4c7d0f95c525547c5cfb1709bd1c0bf94 Report file object in case of error to be helpful as much as possible diff -r e4ee4bf4c7d0 -r becd2a1310a2 src/org/tmatesoft/hg/core/HgCheckoutCommand.java --- a/src/org/tmatesoft/hg/core/HgCheckoutCommand.java Thu Apr 11 16:27:06 2013 +0200 +++ b/src/org/tmatesoft/hg/core/HgCheckoutCommand.java Fri Apr 12 18:30:55 2013 +0200 @@ -191,17 +191,18 @@ } public boolean next(Nodeid nid, Path fname, Flags flags) { + WorkingDirFileWriter workingDirWriter = null; try { HgDataFile df = hgRepo.getRepo().getFileNode(fname); int fileRevIndex = df.getRevisionIndex(nid); // check out files based on manifest // FIXME links! - WorkingDirFileWriter workingDirWriter = new WorkingDirFileWriter(hgRepo); + workingDirWriter = new WorkingDirFileWriter(hgRepo); workingDirWriter.processFile(df, fileRevIndex); lastWrittenFileSize = workingDirWriter.bytesWritten(); return true; } catch (IOException ex) { - failure = new HgIOException("Failed to write down file revision", ex, /*FIXME file*/null); + failure = new HgIOException("Failed to write down file revision", ex, workingDirWriter.getDestinationFile()); } catch (HgRuntimeException ex) { failure = new HgLibraryFailureException(ex); } diff -r e4ee4bf4c7d0 -r becd2a1310a2 src/org/tmatesoft/hg/internal/WorkingDirFileWriter.java --- a/src/org/tmatesoft/hg/internal/WorkingDirFileWriter.java Thu Apr 11 16:27:06 2013 +0200 +++ b/src/org/tmatesoft/hg/internal/WorkingDirFileWriter.java Fri Apr 12 18:30:55 2013 +0200 @@ -45,6 +45,13 @@ hgRepo = internalRepo; } + /** + * Information purposes only, to find out trouble location if {@link #processFile(HgDataFile, int)} fails + */ + public File getDestinationFile() { + return dest; + } + public void processFile(HgDataFile df, int fileRevIndex) throws IOException { try { prepare(df.getPath());