comparison src/org/tmatesoft/hg/core/HgChangesetFileSneaker.java @ 691:72fc7774b87e

Fix file.isCopy() for blame/annotate. Refactor status and blame to use newly introduced FileHistory helper that builds file rename history
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Fri, 02 Aug 2013 23:07:23 +0200
parents b286222158be
children
comparison
equal deleted inserted replaced
690:b286222158be 691:72fc7774b87e
150 int ccFileRevIndex = dataFile.getLastRevision(); // copy candidate 150 int ccFileRevIndex = dataFile.getLastRevision(); // copy candidate
151 int csetFileEnds = dataFile.getChangesetRevisionIndex(ccFileRevIndex); 151 int csetFileEnds = dataFile.getChangesetRevisionIndex(ccFileRevIndex);
152 if (csetIndex > csetFileEnds) { 152 if (csetIndex > csetFileEnds) {
153 return new Outcome(Outcome.Kind.Success, String.format("%s: last known changeset for the file %s is %d. Follow renames is possible towards older changesets only", phaseMsg, file, csetFileEnds)); 153 return new Outcome(Outcome.Kind.Success, String.format("%s: last known changeset for the file %s is %d. Follow renames is possible towards older changesets only", phaseMsg, file, csetFileEnds));
154 } 154 }
155 // XXX code is similar to that in HgStatusCollector#getOriginIfCopy. Why it's different in lastOrigin processing then? 155 // @see FileRenameHistory, with similar code, which doesn't trace alternative paths
156 // traceback stack keeps record of all files with isCopy(fileRev) == true we've tried to follow, so that we can try earlier file 156 // traceback stack keeps record of all files with isCopy(fileRev) == true we've tried to follow, so that we can try earlier file
157 // revisions in case followed fileRev didn't succeed 157 // revisions in case followed fileRev didn't succeed
158 ArrayDeque<Pair<HgDataFile, Integer>> traceback = new ArrayDeque<Pair<HgDataFile, Integer>>(); 158 ArrayDeque<Pair<HgDataFile, Integer>> traceback = new ArrayDeque<Pair<HgDataFile, Integer>>();
159 do { 159 do {
160 int ccCsetIndex = dataFile.getChangesetRevisionIndex(ccFileRevIndex); 160 int ccCsetIndex = dataFile.getChangesetRevisionIndex(ccFileRevIndex);