Mercurial > jhg
diff src/com/tmate/hgkit/ll/HgBundle.java @ 43:1b26247d7367
Calculate result length of the patch operarion, when unknown
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Fri, 14 Jan 2011 04:41:05 +0100 |
parents | 92c3d0920d58 |
children | 70dafe20931d |
line wrap: on
line diff
--- a/src/com/tmate/hgkit/ll/HgBundle.java Fri Jan 14 04:29:03 2011 +0100 +++ b/src/com/tmate/hgkit/ll/HgBundle.java Fri Jan 14 04:41:05 2011 +0100 @@ -45,8 +45,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) { - int resultLen = 10000; // XXX calculate based on baseRevContent.length and ge.patches - byte[] csetContent = RevlogStream.apply(baseRevContent, resultLen, ge.patches); + byte[] csetContent = RevlogStream.apply(baseRevContent, -1, ge.patches); // wiki suggests sha1_digest(min(p1,p2) ++ max(p1,p2) ++ final_text), 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())) {