instead of 'origin' to track upstream
usage_checkoutBranchAfterClone=checkout named branch instead of remotes's HEAD
usage_viewCommitHistory=View commit history
-usage_orphan=Create a new orphan branch. The first commit made on this new branch will have no parents amd it will be the root of a new history totally disconnected from other branches and commits.
\ No newline at end of file
+usage_orphan=Create a new orphan branch. The first commit made on this new branch will have no parents amd it will be the root of a new history totally disconnected from other branches and commits.
+usernameFor=Username for {0}:
diff --git a/org.eclipse.jgit.console/src/org/eclipse/jgit/console/ConsoleAuthenticator.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/console/ConsoleAuthenticator.java
similarity index 88%
rename from org.eclipse.jgit.console/src/org/eclipse/jgit/console/ConsoleAuthenticator.java
rename to org.eclipse.jgit.pgm/src/org/eclipse/jgit/console/ConsoleAuthenticator.java
index 941205af3..bdaccb065 100644
--- a/org.eclipse.jgit.console/src/org/eclipse/jgit/console/ConsoleAuthenticator.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/console/ConsoleAuthenticator.java
@@ -51,13 +51,20 @@ import java.text.MessageFormat;
import org.eclipse.jgit.util.CachedAuthenticator;
-/** Basic network prompt for username/password when using the console. */
+import org.eclipse.jgit.pgm.internal.CLIText;
+
+/**
+ * Basic network prompt for username/password when using the console.
+ *
+ * @since 4.0
+ */
public class ConsoleAuthenticator extends CachedAuthenticator {
/** Install this authenticator implementation into the JVM. */
public static void install() {
final ConsoleAuthenticator c = new ConsoleAuthenticator();
if (c.cons == null)
- throw new NoClassDefFoundError(ConsoleText.get().noSystemConsoleAvailable);
+ throw new NoClassDefFoundError(
+ CLIText.get().noSystemConsoleAvailable);
Authenticator.setDefault(c);
}
@@ -66,11 +73,12 @@ public class ConsoleAuthenticator extends CachedAuthenticator {
@Override
protected PasswordAuthentication promptPasswordAuthentication() {
final String realm = formatRealm();
- String username = cons.readLine(MessageFormat.format(ConsoleText.get().usernameFor + " ", realm)); //$NON-NLS-1$
+ String username = cons.readLine(MessageFormat.format(
+ CLIText.get().usernameFor + " ", realm)); //$NON-NLS-1$
if (username == null || username.isEmpty()) {
return null;
}
- char[] password = cons.readPassword(ConsoleText.get().password + " "); //$NON-NLS-1$
+ char[] password = cons.readPassword(CLIText.get().password + " "); //$NON-NLS-1$
if (password == null) {
password = new char[0];
}
diff --git a/org.eclipse.jgit.console/src/org/eclipse/jgit/console/ConsoleCredentialsProvider.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/console/ConsoleCredentialsProvider.java
similarity index 94%
rename from org.eclipse.jgit.console/src/org/eclipse/jgit/console/ConsoleCredentialsProvider.java
rename to org.eclipse.jgit.pgm/src/org/eclipse/jgit/console/ConsoleCredentialsProvider.java
index a01fd86b4..e805add81 100644
--- a/org.eclipse.jgit.console/src/org/eclipse/jgit/console/ConsoleCredentialsProvider.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/console/ConsoleCredentialsProvider.java
@@ -54,14 +54,20 @@ import org.eclipse.jgit.transport.CredentialsProvider;
import org.eclipse.jgit.transport.NetRCCredentialsProvider;
import org.eclipse.jgit.transport.URIish;
-/** Interacts with the user during authentication by using the text console. */
+import org.eclipse.jgit.pgm.internal.CLIText;
+
+/**
+ * Interacts with the user during authentication by using the text console.
+ *
+ * @since 4.0
+ */
public class ConsoleCredentialsProvider extends CredentialsProvider {
/** Install this implementation as the default. */
public static void install() {
final ConsoleCredentialsProvider c = new ConsoleCredentialsProvider();
if (c.cons == null)
throw new NoClassDefFoundError(
- ConsoleText.get().noSystemConsoleAvailable);
+ CLIText.get().noSystemConsoleAvailable);
CredentialsProvider cp = new ChainingCredentialsProvider(
new NetRCCredentialsProvider(), c);
CredentialsProvider.setDefault(cp);
@@ -168,9 +174,9 @@ public class ConsoleCredentialsProvider extends CredentialsProvider {
private boolean get(CredentialItem.YesNoType item) {
String r = cons.readLine("%s [%s/%s]? ", item.getPromptText(), //$NON-NLS-1$
- ConsoleText.get().answerYes, ConsoleText.get().answerNo);
+ CLIText.get().answerYes, CLIText.get().answerNo);
if (r != null) {
- item.setValue(ConsoleText.get().answerYes.equalsIgnoreCase(r));
+ item.setValue(CLIText.get().answerYes.equalsIgnoreCase(r));
return true;
} else {
return false;
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Main.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Main.java
index 7151de794..38c3a2fcd 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Main.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Main.java
@@ -47,15 +47,14 @@ package org.eclipse.jgit.pgm;
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
-import java.lang.reflect.InvocationTargetException;
import java.net.MalformedURLException;
import java.net.URL;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;
-import org.eclipse.jgit.awtui.AwtAuthenticator;
-import org.eclipse.jgit.awtui.AwtCredentialsProvider;
+import org.eclipse.jgit.console.ConsoleAuthenticator;
+import org.eclipse.jgit.console.ConsoleCredentialsProvider;
import org.eclipse.jgit.errors.TransportException;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.lib.RepositoryBuilder;
@@ -116,10 +115,8 @@ public class Main {
*/
protected void run(final String[] argv) {
try {
- if (!installConsole()) {
- AwtAuthenticator.install();
- AwtCredentialsProvider.install();
- }
+ ConsoleAuthenticator.install();
+ ConsoleCredentialsProvider.install();
configureHttpProxy();
execute(argv);
} catch (Die err) {
@@ -249,45 +246,6 @@ public class Main {
return rb.build();
}
- private static boolean installConsole() {
- try {
- install("org.eclipse.jgit.console.ConsoleAuthenticator"); //$NON-NLS-1$
- install("org.eclipse.jgit.console.ConsoleCredentialsProvider"); //$NON-NLS-1$
- return true;
- } catch (ClassNotFoundException e) {
- return false;
- } catch (NoClassDefFoundError e) {
- return false;
- } catch (UnsupportedClassVersionError e) {
- return false;
-
- } catch (IllegalArgumentException e) {
- throw new RuntimeException(CLIText.get().cannotSetupConsole, e);
- } catch (SecurityException e) {
- throw new RuntimeException(CLIText.get().cannotSetupConsole, e);
- } catch (IllegalAccessException e) {
- throw new RuntimeException(CLIText.get().cannotSetupConsole, e);
- } catch (InvocationTargetException e) {
- throw new RuntimeException(CLIText.get().cannotSetupConsole, e);
- } catch (NoSuchMethodException e) {
- throw new RuntimeException(CLIText.get().cannotSetupConsole, e);
- }
- }
-
- private static void install(final String name)
- throws IllegalAccessException, InvocationTargetException,
- NoSuchMethodException, ClassNotFoundException {
- try {
- Class.forName(name).getMethod("install").invoke(null); //$NON-NLS-1$
- } catch (InvocationTargetException e) {
- if (e.getCause() instanceof RuntimeException)
- throw (RuntimeException) e.getCause();
- if (e.getCause() instanceof Error)
- throw (Error) e.getCause();
- throw e;
- }
- }
-
/**
* Configure the JRE's standard HTTP based on http_proxy
.
*
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/internal/CLIText.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/internal/CLIText.java
index e7d995e6a..433ddf2b1 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/internal/CLIText.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/internal/CLIText.java
@@ -77,6 +77,8 @@ public class CLIText extends TranslationBundle {
// @formatter:off
/***/ public String alreadyOnBranch;
/***/ public String alreadyUpToDate;
+ /***/ public String answerNo;
+ /***/ public String answerYes;
/***/ public String authorInfo;
/***/ public String averageMSPerRead;
/***/ public String branchAlreadyExists;
@@ -191,6 +193,7 @@ public class CLIText extends TranslationBundle {
/***/ public String noSuchRemoteRef;
/***/ public String noTREESectionInIndex;
/***/ public String nonFastForward;
+ /***/ public String noSystemConsoleAvailable;
/***/ public String notABranch;
/***/ public String notACommit;
/***/ public String notAGitRepository;
@@ -208,6 +211,7 @@ public class CLIText extends TranslationBundle {
/***/ public String onBranch;
/***/ public String onlyOneMetaVarExpectedIn;
/***/ public String onlyOneOfIncludeOnlyAllInteractiveCanBeUsed;
+ /***/ public String password;
/***/ public String pathspecDidNotMatch;
/***/ public String pushTo;
/***/ public String pathsRequired;
@@ -245,4 +249,5 @@ public class CLIText extends TranslationBundle {
/***/ public String unsupportedOperation;
/***/ public String untrackedFiles;
/***/ public String updating;
+ /***/ public String usernameFor;
}
diff --git a/org.eclipse.jgit.test/META-INF/MANIFEST.MF b/org.eclipse.jgit.test/META-INF/MANIFEST.MF
index 0b3095831..f1c610b4f 100644
--- a/org.eclipse.jgit.test/META-INF/MANIFEST.MF
+++ b/org.eclipse.jgit.test/META-INF/MANIFEST.MF
@@ -13,7 +13,6 @@ Import-Package: com.googlecode.javaewah;version="[0.7.9,0.8.0)",
org.eclipse.jgit.attributes;version="[4.0.0,4.1.0)",
org.eclipse.jgit.awtui;version="[4.0.0,4.1.0)",
org.eclipse.jgit.blame;version="[4.0.0,4.1.0)",
- org.eclipse.jgit.console;version="[4.0.0,4.1.0)",
org.eclipse.jgit.diff;version="[4.0.0,4.1.0)",
org.eclipse.jgit.dircache;version="[4.0.0,4.1.0)",
org.eclipse.jgit.errors;version="[4.0.0,4.1.0)",
diff --git a/org.eclipse.jgit.test/pom.xml b/org.eclipse.jgit.test/pom.xml
index f31f0f557..12dfa6848 100644
--- a/org.eclipse.jgit.test/pom.xml
+++ b/org.eclipse.jgit.test/pom.xml
@@ -110,12 +110,6 @@
${project.version}
-
- org.eclipse.jgit
- org.eclipse.jgit.console
- ${project.version}
-
-
org.eclipse.jgit
org.eclipse.jgit.pgm
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/nls/RootLocaleTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/nls/RootLocaleTest.java
index cae006c94..631ed85b4 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/nls/RootLocaleTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/nls/RootLocaleTest.java
@@ -44,7 +44,6 @@
package org.eclipse.jgit.nls;
import org.eclipse.jgit.awtui.UIText;
-import org.eclipse.jgit.console.ConsoleText;
import org.eclipse.jgit.internal.JGitText;
import org.eclipse.jgit.pgm.internal.CLIText;
import org.junit.Before;
@@ -61,11 +60,6 @@ public class RootLocaleTest {
NLS.getBundleFor(JGitText.class);
}
- @Test
- public void testConsoleText() {
- NLS.getBundleFor(ConsoleText.class);
- }
-
@Test
public void testCLIText() {
NLS.getBundleFor(CLIText.class);
diff --git a/org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/AwtCredentialsProvider.java b/org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/AwtCredentialsProvider.java
deleted file mode 100644
index fd26bfa7f..000000000
--- a/org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/AwtCredentialsProvider.java
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- * Copyright (C) 2010, Google Inc.
- * Copyright (C) 2008, Robin Rosenberg
- * Copyright (C) 2008, Shawn O. Pearce
- * and other copyright owners as documented in the project's IP log.
- *
- * This program and the accompanying materials are made available
- * under the terms of the Eclipse Distribution License v1.0 which
- * accompanies this distribution, is reproduced below, and is
- * available at http://www.eclipse.org/org/documents/edl-v10.php
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or
- * without modification, are permitted provided that the following
- * conditions are met:
- *
- * - Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * - Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- *
- * - Neither the name of the Eclipse Foundation, Inc. nor the
- * names of its contributors may be used to endorse or promote
- * products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
- * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-package org.eclipse.jgit.awtui;
-
-import java.awt.GridBagConstraints;
-import java.awt.GridBagLayout;
-import java.awt.Insets;
-
-import javax.swing.JLabel;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-import javax.swing.JPasswordField;
-import javax.swing.JTextField;
-
-import org.eclipse.jgit.errors.UnsupportedCredentialItem;
-import org.eclipse.jgit.transport.CredentialItem;
-import org.eclipse.jgit.transport.CredentialsProvider;
-import org.eclipse.jgit.transport.URIish;
-
-/** Interacts with the user during authentication by using AWT/Swing dialogs. */
-public class AwtCredentialsProvider extends CredentialsProvider {
- /** Install this implementation as the default. */
- public static void install() {
- CredentialsProvider.setDefault(new AwtCredentialsProvider());
- }
-
- @Override
- public boolean isInteractive() {
- return true;
- }
-
- @Override
- public boolean supports(CredentialItem... items) {
- for (CredentialItem i : items) {
- if (i instanceof CredentialItem.StringType)
- continue;
-
- else if (i instanceof CredentialItem.CharArrayType)
- continue;
-
- else if (i instanceof CredentialItem.YesNoType)
- continue;
-
- else if (i instanceof CredentialItem.InformationalMessage)
- continue;
-
- else
- return false;
- }
- return true;
- }
-
- @Override
- public boolean get(URIish uri, CredentialItem... items)
- throws UnsupportedCredentialItem {
- if (items.length == 0) {
- return true;
-
- } else if (items.length == 1) {
- final CredentialItem item = items[0];
-
- if (item instanceof CredentialItem.InformationalMessage) {
- JOptionPane.showMessageDialog(null, item.getPromptText(),
- UIText.get().warning, JOptionPane.INFORMATION_MESSAGE);
- return true;
-
- } else if (item instanceof CredentialItem.YesNoType) {
- CredentialItem.YesNoType v = (CredentialItem.YesNoType) item;
- int r = JOptionPane.showConfirmDialog(null, v.getPromptText(),
- UIText.get().warning, JOptionPane.YES_NO_OPTION);
- switch (r) {
- case JOptionPane.YES_OPTION:
- v.setValue(true);
- return true;
-
- case JOptionPane.NO_OPTION:
- v.setValue(false);
- return true;
-
- case JOptionPane.CANCEL_OPTION:
- case JOptionPane.CLOSED_OPTION:
- default:
- return false;
- }
-
- } else {
- return interactive(uri, items);
- }
-
- } else {
- return interactive(uri, items);
- }
- }
-
- private static boolean interactive(URIish uri, CredentialItem[] items) {
- final GridBagConstraints gbc = new GridBagConstraints(0, 0, 1, 1, 1, 1,
- GridBagConstraints.NORTHWEST, GridBagConstraints.NONE,
- new Insets(0, 0, 0, 0), 0, 0);
- final JPanel panel = new JPanel();
- panel.setLayout(new GridBagLayout());
-
- final JTextField[] texts = new JTextField[items.length];
- for (int i = 0; i < items.length; i++) {
- CredentialItem item = items[i];
-
- if (item instanceof CredentialItem.StringType
- || item instanceof CredentialItem.CharArrayType) {
- gbc.fill = GridBagConstraints.NONE;
- gbc.gridwidth = GridBagConstraints.RELATIVE;
- gbc.gridx = 0;
- panel.add(new JLabel(item.getPromptText()), gbc);
-
- gbc.fill = GridBagConstraints.HORIZONTAL;
- gbc.gridwidth = GridBagConstraints.RELATIVE;
- gbc.gridx = 1;
- if (item.isValueSecure())
- texts[i] = new JPasswordField(20);
- else
- texts[i] = new JTextField(20);
- panel.add(texts[i], gbc);
- gbc.gridy++;
-
- } else if (item instanceof CredentialItem.InformationalMessage) {
- gbc.fill = GridBagConstraints.NONE;
- gbc.gridwidth = GridBagConstraints.REMAINDER;
- gbc.gridx = 0;
- panel.add(new JLabel(item.getPromptText()), gbc);
- gbc.gridy++;
-
- } else {
- throw new UnsupportedCredentialItem(uri, item.getPromptText());
- }
- }
-
- if (JOptionPane.showConfirmDialog(null, panel,
- UIText.get().authenticationRequired,
- JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE) != JOptionPane.OK_OPTION)
- return false; // cancel
-
- for (int i = 0; i < items.length; i++) {
- CredentialItem item = items[i];
- JTextField f = texts[i];
-
- if (item instanceof CredentialItem.StringType) {
- CredentialItem.StringType v = (CredentialItem.StringType) item;
- if (f instanceof JPasswordField)
- v.setValue(new String(((JPasswordField) f).getPassword()));
- else
- v.setValue(f.getText());
-
- } else if (item instanceof CredentialItem.CharArrayType) {
- CredentialItem.CharArrayType v = (CredentialItem.CharArrayType) item;
- if (f instanceof JPasswordField)
- v.setValueNoCopy(((JPasswordField) f).getPassword());
- else
- v.setValueNoCopy(f.getText().toCharArray());
- }
- }
- return true;
- }
-}
diff --git a/pom.xml b/pom.xml
index 94a88e6db..863866df6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -566,24 +566,11 @@
-
- jgit.java6
-
- [1.6,)
-
-
- org.eclipse.jgit.console
-
-
jgit.java7
[1.7,)
-
- org.eclipse.jgit.java7
- org.eclipse.jgit.java7.test
-
jgit.java8
@@ -691,9 +678,11 @@
org.eclipse.jgit.http.apache
org.eclipse.jgit.http.server
org.eclipse.jgit.pgm
+ org.eclipse.jgit.java7
org.eclipse.jgit.junit
org.eclipse.jgit.junit.http
+ org.eclipse.jgit.java7.test
org.eclipse.jgit.test
org.eclipse.jgit.ant.test
org.eclipse.jgit.http.test
diff --git a/tools/maven-central/deploy.rb b/tools/maven-central/deploy.rb
index 929af9cd7..d620a88e1 100755
--- a/tools/maven-central/deploy.rb
+++ b/tools/maven-central/deploy.rb
@@ -51,8 +51,7 @@ group = 'org.eclipse.jgit'
artifacts = [group,
group + '.ant',
group + '.archive',
- group + '.console',
- group + '.http.apache',
+ group + '.http.apache',
group + '.http.server',
group + '.java7',
group + '.junit',
diff --git a/tools/maven-central/download.rb b/tools/maven-central/download.rb
index fc06f7da6..de4ecd426 100755
--- a/tools/maven-central/download.rb
+++ b/tools/maven-central/download.rb
@@ -11,8 +11,7 @@ group = 'org.eclipse.jgit'
artifacts = [group,
group + '.ant',
group + '.archive',
- group + '.console',
- group + '.http.apache',
+ group + '.http.apache',
group + '.http.server',
group + '.java7',
group + '.junit',