Mercurial > hg4j
comparison src/org/tmatesoft/hg/repo/HgBundle.java @ 154:ba2bf656f00f
Changeset => RawChangeset
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Thu, 24 Feb 2011 22:16:19 +0100 |
parents | 645829962785 |
children | d5268ca7715b |
comparison
equal
deleted
inserted
replaced
153:ab7ea2ac21cb | 154:ba2bf656f00f |
---|---|
24 import org.tmatesoft.hg.core.Nodeid; | 24 import org.tmatesoft.hg.core.Nodeid; |
25 import org.tmatesoft.hg.internal.DataAccess; | 25 import org.tmatesoft.hg.internal.DataAccess; |
26 import org.tmatesoft.hg.internal.DataAccessProvider; | 26 import org.tmatesoft.hg.internal.DataAccessProvider; |
27 import org.tmatesoft.hg.internal.DigestHelper; | 27 import org.tmatesoft.hg.internal.DigestHelper; |
28 import org.tmatesoft.hg.internal.RevlogStream; | 28 import org.tmatesoft.hg.internal.RevlogStream; |
29 import org.tmatesoft.hg.repo.HgChangelog.Changeset; | 29 import org.tmatesoft.hg.repo.HgChangelog.RawChangeset; |
30 | 30 |
31 | 31 |
32 /** | 32 /** |
33 * @see http://mercurial.selenic.com/wiki/BundleFormat | 33 * @see http://mercurial.selenic.com/wiki/BundleFormat |
34 * | 34 * |
67 byte[] csetContent = RevlogStream.apply(baseRevContent, -1, ge.patches); | 67 byte[] csetContent = RevlogStream.apply(baseRevContent, -1, ge.patches); |
68 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? | 68 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? |
69 if (!ge.node().equalsTo(dh.asBinary())) { | 69 if (!ge.node().equalsTo(dh.asBinary())) { |
70 throw new IllegalStateException("Integrity check failed on " + bundleFile + ", node:" + ge.node()); | 70 throw new IllegalStateException("Integrity check failed on " + bundleFile + ", node:" + ge.node()); |
71 } | 71 } |
72 Changeset cs = Changeset.parse(csetContent, 0, csetContent.length); | 72 RawChangeset cs = RawChangeset.parse(csetContent, 0, csetContent.length); |
73 System.out.println(cs.toString()); | 73 System.out.println(cs.toString()); |
74 baseRevContent = csetContent; | 74 baseRevContent = csetContent; |
75 } | 75 } |
76 } finally { | 76 } finally { |
77 da.done(); | 77 da.done(); |