* @return date when the file was last modified, never <code>null</code>. Either date of changeset the file was modified at
* or timestamp of local file, if present
* @throws HgRuntimeException subclass thereof to indicate issues with the library. <em>Runtime exception</em>
*/
public Date getModificationDate() throws HgRuntimeException {
RawChangeset cset = logHelper.findLatestChangeWith(path);
if (cset == null) {
File localFile = new File(logHelper.getRepo().getWorkingDir(), path.toString());
if (localFile.canRead()) {
return new Date(localFile.lastModified());
}
// TODO post-1.1 find out what to do in this case, perhaps, throw an exception?
// perhaps check dirstate and for timestamp
return new Date(); // what's correct?
} else {
return cset.date();
}
}