diff src/org/tmatesoft/hg/core/HgChangeset.java @ 316:ee6b467c1a5f

Supply HGFileRevision with copy information when possible, calculate it otherwise
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Wed, 28 Sep 2011 13:09:16 +0200
parents 9fb50c04f03c
children 189dc6dc1c3e
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/core/HgChangeset.java	Wed Sep 28 12:18:21 2011 +0200
+++ b/src/org/tmatesoft/hg/core/HgChangeset.java	Wed Sep 28 13:09:16 2011 +0200
@@ -19,6 +19,7 @@
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
+import java.util.Map;
 
 import org.tmatesoft.hg.repo.HgChangelog.RawChangeset;
 import org.tmatesoft.hg.repo.HgChangelog;
@@ -195,14 +196,15 @@
 			if (nid == null) {
 				throw new HgBadStateException();
 			}
-			modified.add(new HgFileRevision(repo, nid, s));
+			modified.add(new HgFileRevision(repo, nid, s, null));
 		}
+		final Map<Path, Path> copied = r.getCopied();
 		for (Path s : r.getAdded()) {
 			Nodeid nid = r.nodeidAfterChange(s);
 			if (nid == null) {
 				throw new HgBadStateException();
 			}
-			added.add(new HgFileRevision(repo, nid, s));
+			added.add(new HgFileRevision(repo, nid, s, copied.get(s)));
 		}
 		for (Path s : r.getRemoved()) {
 			// with Path from getRemoved, may just copy