comparison src/org/tmatesoft/hg/core/HgFileRevision.java @ 689:5050ee565bd1

Issue 44: Renames/copies other than for the very first revision of a file are not recognized
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Sat, 27 Jul 2013 22:06:14 +0200
parents 6526d8adbc0f
children
comparison
equal deleted inserted replaced
688:1499139a600a 689:5050ee565bd1
166 public String toString() { 166 public String toString() {
167 return String.format("HgFileRevision(%s, %s)", getPath().toString(), revision.shortNotation()); 167 return String.format("HgFileRevision(%s, %s)", getPath().toString(), revision.shortNotation());
168 } 168 }
169 169
170 private void checkCopy() throws HgRuntimeException { 170 private void checkCopy() throws HgRuntimeException {
171 HgDataFile fn = repo.getFileNode(path); 171 HgDataFile df = repo.getFileNode(path);
172 if (fn.isCopy()) { 172 int revIdx = df.getRevisionIndex(revision);
173 if (fn.getRevision(0).equals(revision)) { 173 if (df.isCopy(revIdx)) {
174 // this HgFileRevision represents first revision of the copy 174 isCopy = Boolean.TRUE;
175 isCopy = Boolean.TRUE; 175 origin = df.getCopySource(revIdx).getPath();
176 origin = fn.getCopySourceName(); 176 return;
177 return;
178 }
179 } 177 }
180 isCopy = Boolean.FALSE; 178 isCopy = Boolean.FALSE;
181 } 179 }
182 } 180 }