Skip to content
This repository has been archived by the owner on Dec 13, 2017. It is now read-only.

Commit

Permalink
Updating plugin for Bitbucket Server 5.
Browse files Browse the repository at this point in the history
  • Loading branch information
ar613 committed May 16, 2017
1 parent 8ca23a1 commit 7dc4f3c
Show file tree
Hide file tree
Showing 5 changed files with 8,392 additions and 8 deletions.
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>com.plugin.commitgraph</groupId>
<artifactId>commitgraph</artifactId>
<version>2.1</version>
<version>3.0</version>

<organization>
<name>Chason Choate</name>
Expand Down Expand Up @@ -111,7 +111,7 @@
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<version>3.6.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
Expand All @@ -121,9 +121,9 @@
</build>

<properties>
<bitbucket.version>4.0.2</bitbucket.version>
<bitbucket.version>5.0.1</bitbucket.version>
<bitbucket.data.version>${bitbucket.version}</bitbucket.data.version>
<amps.version>6.1.0</amps.version>
<amps.version>6.3.0</amps.version>
<plugin.testrunner.version>1.2.3</plugin.testrunner.version>
</properties>
</project>
3 changes: 1 addition & 2 deletions src/main/java/networkservlet/NetworkServlet.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@

public class NetworkServlet extends HttpServlet {

private final static String FORMAT = "%H|%P|%aN|%aE|%at".replace( "|", "%x02" ) + "%n%B%n%x03END%x04";
static final String NETWORK_PAGE = "bitbucket.plugin.network";
static final String NETWORK_PAGE_FRAGMENT = "bitbucket.plugin.network_fragment";

Expand Down Expand Up @@ -147,7 +146,7 @@ protected Page<Commit> getCommits(final Repository repository,
CommitsCommandParameters ccp = new CommitsCommandParameters.Builder().all( true ).build();
PagedCommitOutputHandler pcoh = new PagedCommitOutputHandler( repository, ccp, pr );
GitScmCommandBuilder revList = gitScm.getCommandBuilderFactory().builder(repository).command("rev-list");
revList.argumentAt(0, "--pretty=" + FORMAT );
revList.argumentAt(0, "--pretty=" + pcoh.getCommitReader().getFormat() );
revList.argumentAt(1, "--branches=*" );
revList.argumentAt(2, "--tags=*" );
revList.argumentAt(3, "--topo-order" );
Expand Down
15 changes: 13 additions & 2 deletions src/main/java/networkservlet/PagedCommitOutputHandler.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package networkservlet;

import java.io.IOException;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;

Expand All @@ -11,6 +12,7 @@
import com.atlassian.bitbucket.scm.CommandOutputHandler;
import com.atlassian.bitbucket.scm.CommitsCommandParameters;
import com.atlassian.bitbucket.scm.git.command.CommitReader;
import com.atlassian.bitbucket.scm.git.command.CommitReaderSettings;
import com.atlassian.bitbucket.util.Page;
import com.atlassian.bitbucket.util.PageRequest;
import com.atlassian.bitbucket.util.PageUtils;
Expand All @@ -19,12 +21,16 @@ public class PagedCommitOutputHandler extends LineReaderOutputHandler implements
{
private final List<Commit> commits;
private final PageRequest pageRequest;
private final CommitReaderSettings.Builder commitReaderSettingsBuilder;
private final CommitReader commitReader;

public PagedCommitOutputHandler( Repository repository, CommitsCommandParameters parameters, PageRequest pageRequest )
{
super( "UTF-8" );
this.commitReader = new CommitReader( repository, parameters.isWithMessages() )
super( Charset.forName("UTF-8") );
this.commitReaderSettingsBuilder = new CommitReaderSettings.Builder();
commitReaderSettingsBuilder.repository(repository);
commitReaderSettingsBuilder.withMessages(parameters.isWithMessages());
this.commitReader = new CommitReader( commitReaderSettingsBuilder.build() )
{
protected void ping()
{
Expand All @@ -41,6 +47,11 @@ public Page<Commit> getOutput()
return PageUtils.createPage( this.commits, this.pageRequest );
}

public CommitReader getCommitReader()
{
return this.commitReader;
}

protected Commit readCommit( LineReader reader ) throws IOException
{
return this.commitReader.readCommit( reader );
Expand Down
21 changes: 21 additions & 0 deletions src/main/resources/static/js/raphael/license.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License

Copyright (c) 2008-2010 Dmitry Baranovskiy

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Loading

0 comments on commit 7dc4f3c

Please sign in to comment.