Port change API to Gerrit 2.15-rc3
Change-Id: I2403ff138a486a6220b3c09191e1912c36c54d79
diff --git a/github-oauth/pom.xml b/github-oauth/pom.xml
index 669fc92..f56068a 100644
--- a/github-oauth/pom.xml
+++ b/github-oauth/pom.xml
@@ -21,7 +21,7 @@
<parent>
<groupId>com.googlesource.gerrit.plugins.github</groupId>
<artifactId>github-parent</artifactId>
- <version>2.15-SNAPSHOT</version>
+ <version>2.15-rc3</version>
</parent>
<artifactId>github-oauth</artifactId>
<name>Gerrit Code Review - GitHub OAuth login</name>
diff --git a/github-plugin/pom.xml b/github-plugin/pom.xml
index 331e0f9..21c5b61 100644
--- a/github-plugin/pom.xml
+++ b/github-plugin/pom.xml
@@ -20,7 +20,7 @@
<parent>
<artifactId>github-parent</artifactId>
<groupId>com.googlesource.gerrit.plugins.github</groupId>
- <version>2.15-SNAPSHOT</version>
+ <version>2.15-rc3</version>
</parent>
<artifactId>github-plugin</artifactId>
diff --git a/github-plugin/src/main/java/com/googlesource/gerrit/plugins/github/git/PullRequestCreateChange.java b/github-plugin/src/main/java/com/googlesource/gerrit/plugins/github/git/PullRequestCreateChange.java
index 2b4a33e..e053920 100644
--- a/github-plugin/src/main/java/com/googlesource/gerrit/plugins/github/git/PullRequestCreateChange.java
+++ b/github-plugin/src/main/java/com/googlesource/gerrit/plugins/github/git/PullRequestCreateChange.java
@@ -34,7 +34,7 @@
import com.google.gerrit.server.change.ChangeInserter;
import com.google.gerrit.server.change.PatchSetInserter;
import com.google.gerrit.server.git.IntegrationException;
-import com.google.gerrit.server.project.ChangeControl;
+import com.google.gerrit.server.notedb.ChangeNotes;
import com.google.gerrit.server.project.InvalidChangeOperationException;
import com.google.gerrit.server.project.NoSuchChangeException;
import com.google.gerrit.server.project.NoSuchProjectException;
@@ -202,9 +202,7 @@
// patch-set
ChangeData destChangeData = destChanges.get(0);
Change destChange = destChangeData.change();
- ChangeControl changeControl =
- projectControlFactory.controlFor(project.getNameKey()).controlFor(destChangeData.notes());
- insertPatchSet(bu, repo, destChange, pullRequestCommit, changeControl, pullRequestMesage);
+ insertPatchSet(bu, repo, destChange, pullRequestCommit, destChangeData.notes(), pullRequestMesage);
return destChange.getId();
}
@@ -240,14 +238,14 @@
Repository git,
Change change,
RevCommit cherryPickCommit,
- ChangeControl changeControl,
+ ChangeNotes changeNotes,
String pullRequestMessage)
throws IOException, UpdateException, RestApiException {
try (RevWalk revWalk = new RevWalk(git)) {
PatchSet.Id psId = ChangeUtil.nextPatchSetId(git, change.currentPatchSetId());
PatchSetInserter patchSetInserter =
- patchSetInserterFactory.create(changeControl, psId, cherryPickCommit);
+ patchSetInserterFactory.create(changeNotes, psId, cherryPickCommit);
patchSetInserter.setMessage(pullRequestMessage);
patchSetInserter.setValidate(false);
diff --git a/pom.xml b/pom.xml
index c4049df..3ce9c3d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -18,7 +18,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.googlesource.gerrit.plugins.github</groupId>
<artifactId>github-parent</artifactId>
- <version>2.15-SNAPSHOT</version>
+ <version>2.15-rc3</version>
<name>Gerrit Code Review - GitHub integration</name>
<url>http://www.gerritforge.com</url>
<packaging>pom</packaging>