diff src/com/tmate/hgkit/ll/HgBundle.java @ 51:9429c7bd1920 wrap-data-access

Try DataAccess to reach revision data instead of plain byte arrays
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Sun, 16 Jan 2011 01:20:26 +0100
parents b01500fe2604
children
line wrap: on
line diff
--- a/src/com/tmate/hgkit/ll/HgBundle.java	Sat Jan 15 01:41:49 2011 +0100
+++ b/src/com/tmate/hgkit/ll/HgBundle.java	Sun Jan 16 01:20:26 2011 +0100
@@ -8,6 +8,7 @@
 import java.util.LinkedList;
 import java.util.List;
 
+import com.tmate.hgkit.fs.ByteArrayDataAccess;
 import com.tmate.hgkit.fs.DataAccess;
 import com.tmate.hgkit.fs.DataAccessProvider;
 
@@ -45,7 +46,7 @@
 			// (the previous, or parent patch of a given patch p is the patch that has a node equal to p's p1 field)
 			byte[] baseRevContent = hgRepo.getChangelog().content(base);
 			for (GroupElement ge : changelogGroup) {
-				byte[] csetContent = RevlogStream.apply(baseRevContent, -1, ge.patches);
+				byte[] csetContent = RevlogStream.apply(new ByteArrayDataAccess(baseRevContent), -1, ge.patches);
 				dh = dh.sha1(ge.firstParent(), ge.secondParent(), csetContent); // XXX ge may give me access to byte[] content of nodeid directly, perhaps, I don't need DH to be friend of Nodeid?
 				if (!ge.node().equalsTo(dh.asBinary())) {
 					throw new IllegalStateException("Integrity check failed on " + bundleFile + ", node:" + ge.node());