comparison src/org/tmatesoft/hg/repo/HgStatusCollector.java @ 320:678e326fd27c

Issue 15: Exception accessing oddly named file from history
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Fri, 30 Sep 2011 06:22:11 +0200
parents ee6b467c1a5f
children 5f9073eabf06
comparison
equal deleted inserted replaced
319:fa4aea41746e 320:678e326fd27c
288 return rv; 288 return rv;
289 } 289 }
290 290
291 /*package-local*/static Path getOriginIfCopy(HgRepository hgRepo, Path fname, Collection<Path> originals, int originalChangelogRevision) throws HgDataStreamException { 291 /*package-local*/static Path getOriginIfCopy(HgRepository hgRepo, Path fname, Collection<Path> originals, int originalChangelogRevision) throws HgDataStreamException {
292 HgDataFile df = hgRepo.getFileNode(fname); 292 HgDataFile df = hgRepo.getFileNode(fname);
293 if (!df.exists()) {
294 String msg = String.format("Didn't find file '%s' in the repo. Perhaps, bad storage name conversion?", fname);
295 throw new HgDataStreamException(fname, msg, null).setRevisionNumber(originalChangelogRevision);
296 }
293 while (df.isCopy()) { 297 while (df.isCopy()) {
294 Path original = df.getCopySourceName(); 298 Path original = df.getCopySourceName();
295 if (originals.contains(original)) { 299 if (originals.contains(original)) {
296 df = hgRepo.getFileNode(original); 300 df = hgRepo.getFileNode(original);
297 int changelogRevision = df.getChangesetLocalRevision(0); 301 int changelogRevision = df.getChangesetLocalRevision(0);