comparison src/org/tmatesoft/hg/core/LogCommand.java @ 126:b92a638764be

Dispatch chnagesets even if Handler is not FileHistoryHandler
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Tue, 15 Feb 2011 07:03:14 +0100
parents 7ec89d637f50
children 645829962785
comparison
equal deleted inserted replaced
125:26ad21b250e4 126:b92a638764be
173 if (file == null) { 173 if (file == null) {
174 repo.getChangelog().range(startRev, endRev, this); 174 repo.getChangelog().range(startRev, endRev, this);
175 } else { 175 } else {
176 HgDataFile fileNode = repo.getFileNode(file); 176 HgDataFile fileNode = repo.getFileNode(file);
177 fileNode.history(startRev, endRev, this); 177 fileNode.history(startRev, endRev, this);
178 if (handler instanceof FileHistoryHandler && fileNode.isCopy()) { 178 if (fileNode.isCopy()) {
179 // even if we do not follow history, report file rename 179 // even if we do not follow history, report file rename
180 do { 180 do {
181 FileRevision src = new FileRevision(repo, fileNode.getCopySourceRevision(), fileNode.getCopySourceName()); 181 if (handler instanceof FileHistoryHandler) {
182 FileRevision dst = new FileRevision(repo, fileNode.getRevision(0), fileNode.getPath()); 182 FileRevision src = new FileRevision(repo, fileNode.getCopySourceRevision(), fileNode.getCopySourceName());
183 ((FileHistoryHandler) handler).copy(src, dst); 183 FileRevision dst = new FileRevision(repo, fileNode.getRevision(0), fileNode.getPath());
184 ((FileHistoryHandler) handler).copy(src, dst);
185 }
184 if (limit > 0 && count >= limit) { 186 if (limit > 0 && count >= limit) {
185 // if limit reach, follow is useless. 187 // if limit reach, follow is useless.
186 break; 188 break;
187 } 189 }
188 if (followHistory) { 190 if (followHistory) {
189 fileNode = repo.getFileNode(src.getPath()); 191 fileNode = repo.getFileNode(fileNode.getCopySourceName());
190 fileNode.history(this); 192 fileNode.history(this);
191 } 193 }
192 } while (followHistory && fileNode.isCopy()); 194 } while (followHistory && fileNode.isCopy());
193 } 195 }
194 } 196 }