summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@gmail.com>2017-08-31 22:01:04 -0400
committerGerrit Code Review @ Eclipse.org <gerrit@eclipse.org>2017-08-31 22:01:04 -0400
commit37ea57701b260dc2eb8b859ab3def6dd49dd4f3d (patch)
tree1c53c4e3500dc35464e977e16858cce4d9868ccb
parent53deba1b4fd8724e618258189deea9c000b94dce (diff)
parent3af57b52a3dcdfab5ca38eca0972f02c20000e5f (diff)
downloadjgit-37ea57701b260dc2eb8b859ab3def6dd49dd4f3d.tar.gz
jgit-37ea57701b260dc2eb8b859ab3def6dd49dd4f3d.zip
Merge "Update args4j to 2.33"
-rw-r--r--org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.5.target4
-rw-r--r--org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.6.target4
-rw-r--r--org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.7.target4
-rw-r--r--org.eclipse.jgit.packaging/org.eclipse.jgit.target/orbit/R20170516192513-Oxygen.tpd4
-rw-r--r--org.eclipse.jgit.pgm.test/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ResetTest.java2
-rw-r--r--org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/StatusTest.java2
-rw-r--r--org.eclipse.jgit.pgm/META-INF/MANIFEST.MF4
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Checkout.java2
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Reset.java2
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/RevWalkTextBuiltin.java2
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Status.java2
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/CmdLineParser.java37
-rw-r--r--pom.xml2
14 files changed, 28 insertions, 45 deletions
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.5.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.5.target
index 8051080911..59ce8da8d1 100644
--- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.5.target
+++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.5.target
@@ -73,8 +73,8 @@
<unit id="org.apache.httpcomponents.httpclient.source" version="4.3.6.v201511171540"/>
<unit id="org.apache.log4j" version="1.2.15.v201012070815"/>
<unit id="org.apache.log4j.source" version="1.2.15.v201012070815"/>
- <unit id="org.kohsuke.args4j" version="2.0.21.v201301150030"/>
- <unit id="org.kohsuke.args4j.source" version="2.0.21.v201301150030"/>
+ <unit id="org.kohsuke.args4j" version="2.33.0.v20160323-2218"/>
+ <unit id="org.kohsuke.args4j.source" version="2.33.0.v20160323-2218"/>
<unit id="org.hamcrest.core" version="1.3.0.v201303031735"/>
<unit id="org.hamcrest.core.source" version="1.3.0.v201303031735"/>
<unit id="org.hamcrest.library" version="1.3.0.v201505072020"/>
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.6.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.6.target
index b6bbcdaf2e..ba00d34405 100644
--- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.6.target
+++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.6.target
@@ -35,8 +35,8 @@
<unit id="org.apache.httpcomponents.httpclient.source" version="4.3.6.v201511171540"/>
<unit id="org.apache.log4j" version="1.2.15.v201012070815"/>
<unit id="org.apache.log4j.source" version="1.2.15.v201012070815"/>
- <unit id="org.kohsuke.args4j" version="2.0.21.v201301150030"/>
- <unit id="org.kohsuke.args4j.source" version="2.0.21.v201301150030"/>
+ <unit id="org.kohsuke.args4j" version="2.33.0.v20160323-2218"/>
+ <unit id="org.kohsuke.args4j.source" version="2.33.0.v20160323-2218"/>
<unit id="org.hamcrest.core" version="1.3.0.v201303031735"/>
<unit id="org.hamcrest.core.source" version="1.3.0.v201303031735"/>
<unit id="org.hamcrest.library" version="1.3.0.v201505072020"/>
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.7.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.7.target
index 6071c8facf..c1757dabd8 100644
--- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.7.target
+++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.7.target
@@ -35,8 +35,8 @@
<unit id="org.apache.httpcomponents.httpclient.source" version="4.3.6.v201511171540"/>
<unit id="org.apache.log4j" version="1.2.15.v201012070815"/>
<unit id="org.apache.log4j.source" version="1.2.15.v201012070815"/>
- <unit id="org.kohsuke.args4j" version="2.0.21.v201301150030"/>
- <unit id="org.kohsuke.args4j.source" version="2.0.21.v201301150030"/>
+ <unit id="org.kohsuke.args4j" version="2.33.0.v20160323-2218"/>
+ <unit id="org.kohsuke.args4j.source" version="2.33.0.v20160323-2218"/>
<unit id="org.hamcrest.core" version="1.3.0.v201303031735"/>
<unit id="org.hamcrest.core.source" version="1.3.0.v201303031735"/>
<unit id="org.hamcrest.library" version="1.3.0.v201505072020"/>
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/orbit/R20170516192513-Oxygen.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/orbit/R20170516192513-Oxygen.tpd
index ef19fa6d24..5614f7d9ba 100644
--- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/orbit/R20170516192513-Oxygen.tpd
+++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/orbit/R20170516192513-Oxygen.tpd
@@ -14,8 +14,8 @@ location "http://download.eclipse.org/tools/orbit/downloads/drops/R2017051619251
org.apache.httpcomponents.httpclient.source [4.3.6.v201511171540,4.3.6.v201511171540]
org.apache.log4j [1.2.15.v201012070815,1.2.15.v201012070815]
org.apache.log4j.source [1.2.15.v201012070815,1.2.15.v201012070815]
- org.kohsuke.args4j [2.0.21.v201301150030,2.0.21.v201301150030]
- org.kohsuke.args4j.source [2.0.21.v201301150030,2.0.21.v201301150030]
+ org.kohsuke.args4j [2.33.0.v20160323-2218,2.33.0.v20160323-2218]
+ org.kohsuke.args4j.source [2.33.0.v20160323-2218,2.33.0.v20160323-2218]
org.hamcrest.core [1.3.0.v201303031735,1.3.0.v201303031735]
org.hamcrest.core.source [1.3.0.v201303031735,1.3.0.v201303031735]
org.hamcrest.library [1.3.0.v201505072020,1.3.0.v201505072020]
diff --git a/org.eclipse.jgit.pgm.test/META-INF/MANIFEST.MF b/org.eclipse.jgit.pgm.test/META-INF/MANIFEST.MF
index 44864c3117..506e2c1a1b 100644
--- a/org.eclipse.jgit.pgm.test/META-INF/MANIFEST.MF
+++ b/org.eclipse.jgit.pgm.test/META-INF/MANIFEST.MF
@@ -27,5 +27,5 @@ Import-Package: org.eclipse.jgit.api;version="[4.9.0,4.10.0)",
org.hamcrest.core;bundle-version="[1.1.0,2.0.0)",
org.junit;version="[4.11.0,5.0.0)",
org.junit.rules;version="[4.11.0,5.0.0)",
- org.kohsuke.args4j;version="[2.0.12,2.1.0)"
+ org.kohsuke.args4j;version="[2.33.0,3.0.0)"
Require-Bundle: org.tukaani.xz;bundle-version="[1.3.0,2.0.0)"
diff --git a/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ResetTest.java b/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ResetTest.java
index 44a7630c8a..81287c1db3 100644
--- a/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ResetTest.java
+++ b/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ResetTest.java
@@ -69,7 +69,7 @@ public class ResetTest extends CLIRepositoryTestCase {
public void testPathOptionHelp() throws Exception {
String[] result = execute("git reset -h");
assertTrue("Unexpected argument: " + result[1],
- result[1].endsWith("[-- path ... ...]"));
+ result[1].endsWith("[-- path ...]"));
}
@Test
diff --git a/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/StatusTest.java b/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/StatusTest.java
index 368047c602..cc68da22e3 100644
--- a/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/StatusTest.java
+++ b/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/StatusTest.java
@@ -60,7 +60,7 @@ public class StatusTest extends CLIRepositoryTestCase {
public void testPathOptionHelp() throws Exception {
String[] result = execute("git status -h");
assertTrue("Unexpected argument: " + result[1],
- result[1].endsWith("[-- path ... ...]"));
+ result[1].endsWith("[-- path ...]"));
}
@Test
diff --git a/org.eclipse.jgit.pgm/META-INF/MANIFEST.MF b/org.eclipse.jgit.pgm/META-INF/MANIFEST.MF
index c59f636a51..bbff4f7f9b 100644
--- a/org.eclipse.jgit.pgm/META-INF/MANIFEST.MF
+++ b/org.eclipse.jgit.pgm/META-INF/MANIFEST.MF
@@ -64,8 +64,8 @@ Import-Package: javax.servlet;version="[3.1.0,4.0.0)",
org.eclipse.jgit.treewalk.filter;version="[4.9.0,4.10.0)",
org.eclipse.jgit.util;version="[4.9.0,4.10.0)",
org.eclipse.jgit.util.io;version="[4.9.0,4.10.0)",
- org.kohsuke.args4j;version="[2.0.12,2.1.0)",
- org.kohsuke.args4j.spi;version="[2.0.15,2.1.0)"
+ org.kohsuke.args4j;version="[2.33.0,3.0.0)",
+ org.kohsuke.args4j.spi;version="[2.33.0,3.0.0)"
Export-Package: org.eclipse.jgit.console;version="4.9.0";
uses:="org.eclipse.jgit.transport,
org.eclipse.jgit.util",
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Checkout.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Checkout.java
index c2f3c4675a..b5cf56e938 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Checkout.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Checkout.java
@@ -77,7 +77,7 @@ class Checkout extends TextBuiltin {
@Argument(required = false, index = 0, metaVar = "metaVar_name", usage = "usage_checkout")
private String name;
- @Option(name = "--", metaVar = "metaVar_paths", multiValued = true, handler = RestOfArgumentsHandler.class)
+ @Option(name = "--", metaVar = "metaVar_paths", handler = RestOfArgumentsHandler.class)
private List<String> paths = new ArrayList<>();
@Override
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Reset.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Reset.java
index 9cee37b791..4c19883c83 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Reset.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Reset.java
@@ -69,7 +69,7 @@ class Reset extends TextBuiltin {
private String commit;
@Argument(required = false, index = 1, metaVar = "metaVar_paths")
- @Option(name = "--", metaVar = "metaVar_paths", multiValued = true, handler = RestOfArgumentsHandler.class)
+ @Option(name = "--", metaVar = "metaVar_paths", handler = RestOfArgumentsHandler.class)
private List<String> paths = new ArrayList<>();
@Override
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/RevWalkTextBuiltin.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/RevWalkTextBuiltin.java
index 5b691f60d9..6b0744d51a 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/RevWalkTextBuiltin.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/RevWalkTextBuiltin.java
@@ -124,7 +124,7 @@ abstract class RevWalkTextBuiltin extends TextBuiltin {
private String followPath;
@Argument(index = 0, metaVar = "metaVar_commitish")
- private final List<RevCommit> commits = new ArrayList<>();
+ private List<RevCommit> commits = new ArrayList<>();
@Option(name = "--", metaVar = "metaVar_path", handler = PathTreeFilterHandler.class)
protected TreeFilter pathFilter = TreeFilter.ALL;
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Status.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Status.java
index b7f5e58285..adcfea4dc3 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Status.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Status.java
@@ -83,7 +83,7 @@ class Status extends TextBuiltin {
protected String untrackedFilesMode = "all"; // default value //$NON-NLS-1$
@Argument(required = false, index = 0, metaVar = "metaVar_paths")
- @Option(name = "--", metaVar = "metaVar_paths", multiValued = true, handler = RestOfArgumentsHandler.class)
+ @Option(name = "--", metaVar = "metaVar_paths", handler = RestOfArgumentsHandler.class)
protected List<String> filterPaths;
@Override
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/CmdLineParser.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/CmdLineParser.java
index 020b62580f..3dcb2a3147 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/CmdLineParser.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/CmdLineParser.java
@@ -47,7 +47,6 @@ import java.io.IOException;
import java.io.Writer;
import java.lang.reflect.Field;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.ResourceBundle;
@@ -68,6 +67,7 @@ import org.kohsuke.args4j.IllegalAnnotationError;
import org.kohsuke.args4j.NamedOptionDef;
import org.kohsuke.args4j.Option;
import org.kohsuke.args4j.OptionDef;
+import org.kohsuke.args4j.OptionHandlerRegistry;
import org.kohsuke.args4j.spi.OptionHandler;
import org.kohsuke.args4j.spi.RestOfArgumentsHandler;
import org.kohsuke.args4j.spi.Setter;
@@ -82,13 +82,14 @@ import org.kohsuke.args4j.spi.Setter;
*/
public class CmdLineParser extends org.kohsuke.args4j.CmdLineParser {
static {
- registerHandler(AbstractTreeIterator.class,
+ OptionHandlerRegistry registry = OptionHandlerRegistry.getRegistry();
+ registry.registerHandler(AbstractTreeIterator.class,
AbstractTreeIteratorHandler.class);
- registerHandler(ObjectId.class, ObjectIdHandler.class);
- registerHandler(RefSpec.class, RefSpecHandler.class);
- registerHandler(RevCommit.class, RevCommitHandler.class);
- registerHandler(RevTree.class, RevTreeHandler.class);
- registerHandler(List.class, OptionWithValuesListHandler.class);
+ registry.registerHandler(ObjectId.class, ObjectIdHandler.class);
+ registry.registerHandler(RefSpec.class, RefSpecHandler.class);
+ registry.registerHandler(RevCommit.class, RevCommitHandler.class);
+ registry.registerHandler(RevTree.class, RevTreeHandler.class);
+ registry.registerHandler(List.class, OptionWithValuesListHandler.class);
}
private final Repository db;
@@ -267,8 +268,8 @@ public class CmdLineParser extends org.kohsuke.args4j.CmdLineParser {
class MyOptionDef extends OptionDef {
public MyOptionDef(OptionDef o) {
- super(o.usage(), o.metaVar(), o.required(), o.handler(), o
- .isMultiValued());
+ super(o.usage(), o.metaVar(), o.required(), o.help(), o.hidden(),
+ o.handler(), o.isMultiValued());
}
@Override
@@ -300,24 +301,6 @@ public class CmdLineParser extends org.kohsuke.args4j.CmdLineParser {
}
- @SuppressWarnings("unchecked")
- private List<OptionHandler> getOptions() {
- List<OptionHandler> options = null;
- try {
- Field field = org.kohsuke.args4j.CmdLineParser.class
- .getDeclaredField("options"); //$NON-NLS-1$
- field.setAccessible(true);
- options = (List<OptionHandler>) field.get(this);
- } catch (NoSuchFieldException | SecurityException
- | IllegalArgumentException | IllegalAccessException e) {
- // ignore
- }
- if (options == null) {
- return Collections.emptyList();
- }
- return options;
- }
-
@Override
public void printSingleLineUsage(Writer w, ResourceBundle rb) {
List<OptionHandler> options = getOptions();
diff --git a/pom.xml b/pom.xml
index 3e6c55b024..f2a87117f6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -200,7 +200,7 @@
<javaewah-version>1.1.6</javaewah-version>
<junit-version>4.12</junit-version>
<test-fork-count>1C</test-fork-count>
- <args4j-version>2.0.15</args4j-version>
+ <args4j-version>2.33</args4j-version>
<commons-compress-version>1.6</commons-compress-version>
<osgi-core-version>4.3.1</osgi-core-version>
<servlet-api-version>3.1.0</servlet-api-version>