Compare commits

...

3 Commits

Author SHA1 Message Date
Kohsuke Kawaguchi
107a1b83c0 [maven-release-plugin] prepare release github-api-1.12 2011-08-26 18:43:18 -07:00
Kohsuke Kawaguchi
1f8e732d3a added command to disable Wiki 2011-08-26 18:36:29 -07:00
Kohsuke Kawaguchi
d5e52a2468 [maven-release-plugin] prepare for next development iteration 2011-08-26 18:12:18 -07:00
3 changed files with 22 additions and 3 deletions

View File

@@ -7,7 +7,7 @@
</parent>
<artifactId>github-api</artifactId>
<version>1.11</version>
<version>1.12</version>
<name>GitHub API for Java</name>
<url>http://github-api.kohsuke.org/</url>
<description>GitHub API for Java</description>

View File

@@ -207,6 +207,14 @@ public class GHRepository {
.to("/repos/show/" + owner + "/" + name);
}
/**
* Enables or disables Wiki for this repository.
*/
public void enableWiki(boolean v) throws IOException {
new Poster(root).withCredential().with("values[has_wiki]",String.valueOf(v))
.to("/repos/show/" + owner + "/" + name);
}
/**
* Deletes this repository.
*/

View File

@@ -41,8 +41,10 @@ public class AppTest extends TestCase {
public void testApp() throws IOException {
GitHub gitHub = GitHub.connect();
GHPullRequest i = gitHub.getOrganization("jenkinsci").getRepository("parameterized-trigger-plugin").getPullRequest(3);
System.out.println(i);
// tryDisablingIssueTrackers(gitHub);
// tryDisablingWiki(gitHub);
// GHPullRequest i = gitHub.getOrganization("jenkinsci").getRepository("sandbox").getPullRequest(1);
// for (GHIssueComment c : i.getComments())
@@ -87,6 +89,15 @@ public class AppTest extends TestCase {
}
}
private void tryDisablingWiki(GitHub gitHub) throws IOException {
for (GHRepository r : gitHub.getOrganization("jenkinsci").getRepositories().values()) {
if (r.hasWiki()) {
System.out.println("DISABLED "+r.getName());
r.enableWiki(false);
}
}
}
private void tryUpdatingIssueTracker(GitHub gitHub) throws IOException {
GHRepository r = gitHub.getOrganization("jenkinsci").getRepository("lib-task-reactor");
System.out.println(r.hasIssues());