Merge branch 'stable-6.5'
* stable-6.5: Ensure parsed RevCommitCG has derived data from commit-graph Downgrade maven-site-plugin to 3.12.1 Use wagon-ssh-external to deploy Maven site Change-Id: Ide721fb088fa04f6276ac495968a45e732f6e139
This commit is contained in:
commit
75db060673
|
@ -175,12 +175,12 @@
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-site-plugin</artifactId>
|
<artifactId>maven-site-plugin</artifactId>
|
||||||
<version>4.0.0-M4</version>
|
<version>3.12.1</version>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency><!-- add support for ssh/scp -->
|
<dependency><!-- add support for ssh/scp -->
|
||||||
<groupId>org.apache.maven.wagon</groupId>
|
<groupId>org.apache.maven.wagon</groupId>
|
||||||
<artifactId>wagon-ssh</artifactId>
|
<artifactId>wagon-ssh-external</artifactId>
|
||||||
<version>3.5.2</version>
|
<version>3.5.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
|
@ -313,7 +313,7 @@
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-site-plugin</artifactId>
|
<artifactId>maven-site-plugin</artifactId>
|
||||||
<version>3.9.1</version>
|
<version>3.12.1</version>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</pluginManagement>
|
</pluginManagement>
|
||||||
|
|
|
@ -83,6 +83,42 @@ public void testParseHeaders() throws Exception {
|
||||||
assertArrayEquals(notParseInGraph.getParents(), noBody.getParents());
|
assertArrayEquals(notParseInGraph.getParents(), noBody.getParents());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testParseCanonical() throws Exception {
|
||||||
|
RevCommit c1 = commitFile("file1", "1", "master");
|
||||||
|
enableAndWriteCommitGraph();
|
||||||
|
|
||||||
|
RevCommit notParseInGraph = rw.lookupCommit(c1);
|
||||||
|
rw.parseHeaders(notParseInGraph);
|
||||||
|
|
||||||
|
reinitializeRevWalk();
|
||||||
|
RevCommit parseInGraph = rw.lookupCommit(c1);
|
||||||
|
parseInGraph.parseCanonical(rw, rw.getCachedBytes(c1));
|
||||||
|
|
||||||
|
assertTrue(parseInGraph instanceof RevCommitCG);
|
||||||
|
assertNotNull(parseInGraph.getRawBuffer());
|
||||||
|
assertEquals(1, parseInGraph.getGeneration());
|
||||||
|
assertEquals(notParseInGraph.getId(), parseInGraph.getId());
|
||||||
|
assertEquals(notParseInGraph.getTree(), parseInGraph.getTree());
|
||||||
|
assertEquals(notParseInGraph.getCommitTime(),
|
||||||
|
parseInGraph.getCommitTime());
|
||||||
|
assertArrayEquals(notParseInGraph.getParents(),
|
||||||
|
parseInGraph.getParents());
|
||||||
|
|
||||||
|
reinitializeRevWalk();
|
||||||
|
rw.setRetainBody(false);
|
||||||
|
RevCommit noBody = rw.lookupCommit(c1);
|
||||||
|
noBody.parseCanonical(rw, rw.getCachedBytes(c1));
|
||||||
|
|
||||||
|
assertTrue(noBody instanceof RevCommitCG);
|
||||||
|
assertNull(noBody.getRawBuffer());
|
||||||
|
assertEquals(1, noBody.getGeneration());
|
||||||
|
assertEquals(notParseInGraph.getId(), noBody.getId());
|
||||||
|
assertEquals(notParseInGraph.getTree(), noBody.getTree());
|
||||||
|
assertEquals(notParseInGraph.getCommitTime(), noBody.getCommitTime());
|
||||||
|
assertArrayEquals(notParseInGraph.getParents(), noBody.getParents());
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testInitializeShallowCommits() throws Exception {
|
public void testInitializeShallowCommits() throws Exception {
|
||||||
RevCommit c1 = commit(commit());
|
RevCommit c1 = commit(commit());
|
||||||
|
|
|
@ -125,7 +125,15 @@ public static RevCommit parse(RevWalk rw, byte[] raw) throws IOException {
|
||||||
|
|
||||||
int inDegree;
|
int inDegree;
|
||||||
|
|
||||||
private byte[] buffer;
|
/**
|
||||||
|
* Raw unparsed commit body of the commit. Populated only
|
||||||
|
* after {@link #parseCanonical(RevWalk, byte[])} with
|
||||||
|
* {@link RevWalk#isRetainBody()} enable or after
|
||||||
|
* {@link #parseBody(RevWalk)} and {@link #parse(RevWalk, byte[])}.
|
||||||
|
*
|
||||||
|
* @since 6.5.1
|
||||||
|
*/
|
||||||
|
protected byte[] buffer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new commit reference.
|
* Create a new commit reference.
|
||||||
|
|
|
@ -44,10 +44,27 @@ protected RevCommitCG(AnyObjectId id, int graphPosition) {
|
||||||
this.graphPosition = graphPosition;
|
this.graphPosition = graphPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** {@inheritDoc} */
|
||||||
|
@Override
|
||||||
|
void parseCanonical(RevWalk walk, byte[] raw) throws IOException {
|
||||||
|
if (walk.isRetainBody()) {
|
||||||
|
buffer = raw;
|
||||||
|
}
|
||||||
|
parseInGraph(walk);
|
||||||
|
}
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
@Override
|
@Override
|
||||||
void parseHeaders(RevWalk walk) throws MissingObjectException,
|
void parseHeaders(RevWalk walk) throws MissingObjectException,
|
||||||
IncorrectObjectTypeException, IOException {
|
IncorrectObjectTypeException, IOException {
|
||||||
|
if (walk.isRetainBody()) {
|
||||||
|
super.parseBody(walk); // This parses header and body
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
parseInGraph(walk);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void parseInGraph(RevWalk walk) throws IOException {
|
||||||
CommitGraph graph = walk.commitGraph();
|
CommitGraph graph = walk.commitGraph();
|
||||||
CommitGraph.CommitData data = graph.getCommitData(graphPosition);
|
CommitGraph.CommitData data = graph.getCommitData(graphPosition);
|
||||||
if (data == null) {
|
if (data == null) {
|
||||||
|
@ -78,11 +95,7 @@ void parseHeaders(RevWalk walk) throws MissingObjectException,
|
||||||
this.parents = pList;
|
this.parents = pList;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
flags |= PARSED;
|
flags |= PARSED;
|
||||||
if (walk.isRetainBody()) {
|
|
||||||
super.parseBody(walk);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
|
|
6
pom.xml
6
pom.xml
|
@ -344,12 +344,12 @@
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-site-plugin</artifactId>
|
<artifactId>maven-site-plugin</artifactId>
|
||||||
<version>4.0.0-M4</version>
|
<version>3.12.1</version>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency><!-- add support for ssh/scp -->
|
<dependency><!-- add support for ssh/scp -->
|
||||||
<groupId>org.apache.maven.wagon</groupId>
|
<groupId>org.apache.maven.wagon</groupId>
|
||||||
<artifactId>wagon-ssh</artifactId>
|
<artifactId>wagon-ssh-external</artifactId>
|
||||||
<version>3.5.2</version>
|
<version>3.5.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
Loading…
Reference in New Issue