FileReader fr = null;
try {
fr = new FileReader(lastMessage);
CharBuffer cb = CharBuffer.allocate(Internals.ltoi(lastMessage.length()));
fr.read(cb);
return cb.flip().toString();
} catch (IOException ex) {
throw new HgInvalidControlFileException("Can't retrieve message of last commit attempt", ex, lastMessage);
} finally {
new FileUtils(getSessionContext().getLog(), this).closeQuietly(fr, lastMessage);
}