--- /dev/null
+<component name="libraryTable">
+ <library name="jsch-agent-proxy">
+ <CLASSES>
+ <root url="jar://$PROJECT_DIR$/lib/jsch.agentproxy.usocket-nc.jar!/" />
+ <root url="jar://$PROJECT_DIR$/lib/jsch.agentproxy.usocket-jna.jar!/" />
+ <root url="jar://$PROJECT_DIR$/lib/jsch.agentproxy.sshagent.jar!/" />
+ <root url="jar://$PROJECT_DIR$/lib/jsch.agentproxy.pageant.jar!/" />
+ <root url="jar://$PROJECT_DIR$/lib/jsch.agentproxy.core.jar!/" />
+ <root url="jar://$PROJECT_DIR$/lib/jsch.agentproxy.connector-factory.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$PROJECT_DIR$/lib/src/jsch-agent-proxy.zip!/jsch-agent-proxy-0.0.6/jsch-agent-proxy-core/src/main/java" />
+ <root url="jar://$PROJECT_DIR$/lib/src/jsch-agent-proxy.zip!/jsch-agent-proxy-0.0.6/jsch-agent-proxy-pageant/src/main/java" />
+ <root url="jar://$PROJECT_DIR$/lib/src/jsch-agent-proxy.zip!/jsch-agent-proxy-0.0.6/jsch-agent-proxy-sshagent/src/main/java" />
+ <root url="jar://$PROJECT_DIR$/lib/src/jsch-agent-proxy.zip!/jsch-agent-proxy-0.0.6/jsch-agent-proxy-usocket-nc/src/main/java" />
+ <root url="jar://$PROJECT_DIR$/lib/src/jsch-agent-proxy.zip!/jsch-agent-proxy-0.0.6/jsch-agent-proxy-usocket-jna/src/main/java" />
+ <root url="jar://$PROJECT_DIR$/lib/src/jsch-agent-proxy.zip!/jsch-agent-proxy-0.0.6/jsch-agent-proxy-connector-factory/src/main/java" />
+ </SOURCES>
+ </library>
+</component>
\ No newline at end of file
libraryLicense(name: "Automaton", libraryName: "automaton.jar", version: "1.11", license: "BSD", url: "http://www.brics.dk/automaton/", licenseUrl: "http://www.opensource.org/licenses/bsd-license.php")
libraryLicense(name: "DTDParser", version: "1.13", license: "LGPL", url: "http://sourceforge.net/projects/dtdparser/", licenseUrl: "http://www.opensource.org/licenses/lgpl-2.1")
libraryLicense(name: "Gant", version: "1.9.8", libraryName: "gant_groovy2.0-1.9.8.jar", license: "Apache 2.0", url: "http://gant.codehaus.org/", licenseUrl: "http://gant.codehaus.org/Licence")
-libraryLicense(name: "Ganymed", version: "bundled with SVNKit", libraryName: "svnkit.jar", license: "BSD", url: "http://www.ganymed.ethz.ch/ssh2/", licenseUrl: "http://www.ganymed.ethz.ch/ssh2/LICENSE.txt")
libraryLicense(name: "sqljet", version: "bundled with SVNKit", libraryName: "sqljet.jar", license: "link (commercial license)", url: "http://sqljet.com", licenseUrl: "http://svnkit.com/license.html")
libraryLicense(name: "svnkit-javahl", version: "bundled with SVNKit", libraryName: "svnkit-javahl.jar", license: "link (commercial license)", url: "http://www.svnkit.com/", licenseUrl: "http://svnkit.com/license.html")
libraryLicense(name: "javahl", version: "1.7.2", libraryName: "javahl.jar", license: "Apache", url: "http://subversion.apache.org", licenseUrl: "http://www.apache.org/licenses/LICENSE-2.0")
-libraryLicense(name: "Antlr", libraryName: "antlr.jar", version: "3.1.3", license: "BSD", url: "http://www.antlr.org",
- licenseUrl: "http://www.antlr.org/license.html")
+libraryLicense(name: "Antlr", libraryName: "antlr.jar", version: "3.4", license: "BSD", url: "http://www.antlr.org", licenseUrl: "http://www.antlr.org/license.html")
libraryLicense(name: "Guava", version: "14.0.1", license: "Apache 2.0", url: "http://code.google.com/p/guava-libraries/", licenseUrl: "http://ant.apache.org/license.html")
libraryLicense(name: "Guava", libraryName: "guava-tools", version: "14.0.1", license: "Apache 2.0", url: "http://code.google.com/p/guava-libraries/", licenseUrl: "http://ant.apache.org/license.html")
libraryLicense(name: "Groovy", version: "2.2.1", license: "Apache 2.0", url: "http://groovy.codehaus.org/")
libraryLicense(name: "JGoodies Common", libraryName: "jgoodies-common", version: "1.2.1", license: "BSD ", url: "http://www.jgoodies.com/freeware/looks/", licenseUrl: "http://www.jgoodies.com/downloads/libraries.html")
libraryLicense(name: "JNA", libraryName: "jna", version: "3.4.0", license: "LGPL 2.1", url: "https://jna.dev.java.net/", licenseUrl: "http://www.opensource.org/licenses/lgpl-2.1.php")
libraryLicense(name: "JSch", libraryName: "JSch", version: "0.1.50", license: "BSD", url: "http://www.jcraft.com/jsch/", licenseUrl: "http://www.jcraft.com/jsch/LICENSE.txt")
+libraryLicense(name: "jsch-agent-proxy", libraryName: "jsch-agent-proxy", version: "0.0.6", license: "BSD", url: "https://github.com/ymnk/jsch-agent-proxy", licenseUrl: "https://github.com/ymnk/jsch-agent-proxy/blob/master/LICENSE.txt")
+libraryLicense(name: "jsch-agent-proxy for svnkit trilead", libraryName: "jsch.agentproxy.svnkit-trilead-ssh2.jar", version: "0.0.6", license: "BSD", url: "https://github.com/ymnk/jsch-agent-proxy", licenseUrl: "https://github.com/ymnk/jsch-agent-proxy/blob/master/LICENSE.txt")
libraryLicense(name: "JUnit", libraryName: "JUnit3", version: "3.8.1", license: "CPL 1.0", url: "http://junit.org/")
libraryLicense(name: "JUnit", libraryName: "JUnit4", version: "4.11", license: "CPL 1.0", url: "http://junit.org/")
libraryLicense(name: "Log4j", libraryName: "Log4J", version: "1.2.17", license: "Apache 2.0", url: "http://logging.apache.org/log4j/1.2/index.html", licenseUrl: "http://logging.apache.org/license.html")
libraryLicense(name: "Sonatype Nexus: Indexer", libraryName: "nexus-indexer-1.2.3.jar", version: "1.2.3", license: "Eclipse Public License v1.0", url: "http://nexus.sonatype.org/", licenseUrl: "http://www.eclipse.org/org/documents/epl-v10.html")
libraryLicense(name: "Sonatype Nexus: Indexer", libraryName: "nexus-indexer-3.0.4.jar", version: "3.0.4", license: "Eclipse Public License v1.0", url: "http://nexus.sonatype.org/", licenseUrl: "http://www.eclipse.org/org/documents/epl-v10.html")
libraryLicense(name: "Sonatype Nexus Indexer Artifact", libraryName: "nexus-indexer-artifact-1.0.1.jar", version: "1.0.1", license: "Eclipse Public License v1.0", url: "http://nexus.sonatype.org/", licenseUrl: "http://www.eclipse.org/org/documents/epl-v10.html")
-libraryLicense(name: "SVNKit", libraryName: "svnkit.jar", version: "SVN version, 1.1 branch as of 1 Oct 2007", license: "link (commercial license)", url: "http://www.svnkit.com/", licenseUrl: "http://svnkit.com/license.html")
-libraryLicense(name: "Sequence", libraryName: "sequence-library.jar", version: "bundled with SVNKit", license: "", url:"http://www.syntevo.com", licenseUrl: "http://svn.jetbrains.org/idea/Trunk/bundled/svn4idea/lib/SEQUENCE-LICENSE")
+libraryLicense(name: "SVNKit", libraryName: "svnkit.jar", version: "1.7.11", license: "link (commercial license)", url: "http://www.svnkit.com/", licenseUrl: "http://svnkit.com/license.html")
+libraryLicense(name: "Sequence", libraryName: "sequence-library.jar", version: "bundled with SVNKit", license: "BSD (see LICENSE.txt in sequence-library.jar)", url:"http://www.syntevo.com")
libraryLicense(name: "swingx", libraryName: "swingx", version: "1.6.2", license: "LGPL 2.1", url: "http://java.net/downloads/swingx/", licenseUrl: "http://www.opensource.org/licenses/lgpl-2.1.php")
libraryLicense(name: "TestNG", version: "5.7 snapshot", license: "Apache 2.0", url: "http://testng.org/doc/", licenseUrl: "http://code.google.com/p/testng/")
-libraryLicense(name: "Trilead SSH", libraryName: "trilead-ssh2", version: "build 213", license: "BSD style (see LICENSE.txt in trilead.jar)", url: "http://www.trilead.com/SSH_Library/")
+libraryLicense(name: "Trilead SSH", libraryName: "trilead-ssh2", version: "build 213 and 217", license: "BSD style (see LICENSE.txt in trilead.jar)", url: "http://www.trilead.com/SSH_Library/")
libraryLicense(name: "Trove4j", version: "1.1 (with patches by JetBrains)", license: "LGPL", url: "http://trove4j.sourceforge.net/", licenseUrl: "http://trove4j.sourceforge.net/html/license.html")
libraryLicense(name: "Velocity", version: "1.7", license: "Apache 2.0", url: "http://velocity.apache.org/", licenseUrl: "http://velocity.apache.org/index.html")
libraryLicense(name: "winp", version: "1.17 (patched)", license: "MIT", url: "http://java.net/projects/winp", licenseUrl: "http://opensource.org/licenses/mit-license.php")
jna-utils.jar
jna.jar
jsch-0.1.50.jar
+jsch.agentproxy.connector-factory.jar
+jsch.agentproxy.core.jar
+jsch.agentproxy.pageant.jar
+jsch.agentproxy.sshagent.jar
+jsch.agentproxy.usocket-jna.jar
+jsch.agentproxy.usocket-nc.jar
jsr166e.jar
jsr173_1.0_api.jar
junit-4.11.jar
diff.patience.alg=false
svn.use.terminal=false
+svn.check.repository.supports.merge.info=false
completion.enable.relevant.method.chain.suggestions=false
ide.mac.message.sheets.java.emulation=false
+++ /dev/null
-Copyright (c) 2005 - 2006 Swiss Federal Institute of Technology (ETH Zurich),
- Department of Computer Science (http://www.inf.ethz.ch),
- Christian Plattner. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
-a.) Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-b.) 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.
-c.) Neither the name of ETH Zurich 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.
-
-
-The Java implementations of the AES, Blowfish and 3DES ciphers have been
-taken (and slightly modified) from the cryptography package released by
-"The Legion Of The Bouncy Castle".
-
-Their license states the following:
-
-Copyright (c) 2000 - 2004 The Legion Of The Bouncy Castle
-(http://www.bouncycastle.org)
-
-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.
-
+++ /dev/null
-/*
- * Copyright 2000-2012 JetBrains s.r.o.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jetbrains.idea.svn;
-
-import com.intellij.openapi.project.Project;
-import com.intellij.openapi.vfs.LocalFileSystem;
-import com.intellij.openapi.vfs.VirtualFile;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
-
-import java.io.File;
-
-/**
- * Created by IntelliJ IDEA.
- * User: Irina.Chernushina
- * Date: 1/12/12
- * Time: 3:25 PM
- */
-public class Svn17Detector {
- public static final LocalFileSystem ourLfs = LocalFileSystem.getInstance();
-
- public static boolean is17(@Nullable final Project project, @NotNull final File file) {
- if (project != null) {
- final VirtualFile vf = ourLfs.findFileByIoFile(file);
- if (vf != null) {
- final WorkingCopy root = SvnVcs.getInstance(project).getRootsToWorkingCopies().getWcRoot(vf);
- if (root != null) {
- return root.is17Copy(); // what abt not detected inner WC ???
- }
- }
- }
-
- final File rootIf17 = SvnUtil.getWcCopyRootIf17(file, null);
- return rootIf17 != null;
- }
-
- public static boolean is17(@Nullable final Project project, final VirtualFile file) {
- if (project != null) {
- final WorkingCopy root = SvnVcs.getInstance(project).getRootsToWorkingCopies().getWcRoot(file);
- if (root != null) {
- return root.is17Copy(); // what abt not detected inner WC ???
- }
- }
-
- final File rootIf17 = SvnUtil.getWcCopyRootIf17(new File(file.getPath()), null);
- return rootIf17 != null;
- }
-}
import com.intellij.util.net.HttpConfigurable;
import com.intellij.util.proxy.CommonProxy;
import com.intellij.util.ui.UIUtil;
+import com.trilead.ssh2.auth.AgentProxy;
import org.intellij.lang.annotations.MagicConstant;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.auth.ProviderType;
}
@Override
- public void acknowledgeConnectionSuccessful(SVNURL url) {
+ public void acknowledgeConnectionSuccessful(SVNURL url, String method) {
CommonProxy.getInstance().removeNoProxy(url.getProtocol(), url.getHost(), url.getPort());
SSLExceptionsHelper.removeInfo();
ourThreadLocalProvider.remove();
SVNErrorMessage errorMessage,
SVNAuthentication authentication,
SVNURL url) throws SVNException {
+ showSshAgentErrorIfAny(errorMessage, authentication);
+
SSLExceptionsHelper.removeInfo();
ourThreadLocalProvider.remove();
if (url != null) {
}
}
+ /**
+ * "Pageant is not running" error thrown in PageantConnector.query() method is caught and "eaten" in SVNKit logic.
+ * So for both cases "Pageant is not running" and "There are no valid keys in agent (both no keys at all and no valid keys for host)"
+ * we will get same "Credentials rejected by SSH server" error.
+ */
+ private void showSshAgentErrorIfAny(@Nullable SVNErrorMessage errorMessage, @Nullable SVNAuthentication authentication) {
+ if (errorMessage != null && authentication instanceof SVNSSHAuthentication) {
+ AgentProxy agentProxy = ((SVNSSHAuthentication)authentication).getAgentProxy();
+
+ if (agentProxy != null) {
+ // TODO: Most likely this should be updated with new VcsNotifier api.
+ VcsBalloonProblemNotifier.showOverChangesView(myProject, errorMessage.getFullMessage(), MessageType.ERROR);
+ }
+ }
+ }
+
public void acknowledgeForSSL(boolean accepted, String kind, String realm, SVNErrorMessage message, SVNAuthentication proxy) {
if (accepted && proxy instanceof SVNSSLAuthentication && (((SVNSSLAuthentication) proxy).getCertificateFile() != null)) {
final SVNSSLAuthentication svnsslAuthentication = (SVNSSLAuthentication)proxy;
dialog.title.openssh.v2.private.key=OpenSSH v2 Private Key
dialog.description.openssh.v2.private.key=Select private key file for SSH authentication
checkbox.ssh.keep.for.current.session=&Save Credentials
+radio.ssh.authentication.with.agent=SS&H Agent
label.ssh.user.name=&User name:
radio.ssh.authentication.with.password=Authentication &with password
label.ssh.password=&Password:
create.branch.invalid.revision.error=Invalid revision ''{0}''
create.branch.no.working.copy.error=No working copy found at {0}
create.branch.no.base.location.error=No branch base location selected
+create.branch.switch.on.create.title=Switch after create
+action.name.switch=Switch
import.dialog.title=Import into Subversion
import.dialog.button=Import
repository.browser.add.location.action=Add Repository Location
public int maxAnnotateRevisions = SvnConfiguration.ourMaxAnnotateRevisionsDefault;
@Attribute("myUseAcceleration")
- public SvnConfiguration.UseAcceleration accelerationType = SvnConfiguration.UseAcceleration.nothing;
+ public SvnConfiguration.UseAcceleration accelerationType = SvnConfiguration.UseAcceleration.commandLine;
@Attribute("myAutoUpdateAfterCommit")
public boolean autoUpdateAfterCommit;
@Attribute("SSL_PROTOCOLS")
public SvnConfiguration.SSLProtocols sslProtocols =
- SystemInfo.JAVA_RUNTIME_VERSION.startsWith("1.7") || SystemInfo.JAVA_RUNTIME_VERSION.startsWith("1.8")
- ? SvnConfiguration.SSLProtocols.all
- : SvnConfiguration.SSLProtocols.sslv3;
+ SystemInfo.isJavaVersionAtLeast("1.7") ? SvnConfiguration.SSLProtocols.all : SvnConfiguration.SSLProtocols.sslv3;
@OptionTag("mySSHConnectionTimeout")
public long sshConnectionTimeout = 30 * 1000;
}
public boolean move(VirtualFile file, VirtualFile toDir) throws IOException {
- FileDocumentManager.getInstance().saveAllDocuments();
-
File srcFile = getIOFile(file);
File dstFile = new File(getIOFile(toDir), file.getName());
if (vcs == null) {
return false;
}
+
+ FileDocumentManager.getInstance().saveAllDocuments();
if (sourceVcs == null) {
return createItem(toDir, file.getName(), file.isDirectory(), true);
}
}
public boolean rename(VirtualFile file, String newName) throws IOException {
- FileDocumentManager.getInstance().saveAllDocuments();
-
File srcFile = getIOFile(file);
File dstFile = new File(srcFile.getParentFile(), newName);
SvnVcs vcs = getVCS(file);
if (vcs != null) {
+ FileDocumentManager.getInstance().saveAllDocuments();
+
myFilesToRefresh.add(file.getParent());
return doMove(vcs, srcFile, dstFile);
}
+++ /dev/null
-/*
- * Copyright 2000-2011 JetBrains s.r.o.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jetbrains.idea.svn;
-
-/**
- * Created by IntelliJ IDEA.
- * User: Irina.Chernushina
- * Date: 8/24/11
- * Time: 1:07 PM
- * To change this template use File | Settings | File Templates.
- */
-public class SvnLoadedBranches {
-}
import com.intellij.openapi.util.Ref;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.util.io.FileUtilRt;
+import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vcs.AbstractVcsHelper;
import com.intellij.openapi.vcs.VcsException;
}
public static boolean checkRepositoryVersion15(final SvnVcs vcs, final String url) {
+ // Merge info tracking is supported in repositories since svn 1.5 (June 2008) - see http://subversion.apache.org/docs/release-notes/.
+ // So by default we assume repository supports merge info tracking.
+ if (!Registry.is("svn.check.repository.supports.merge.info")) {
+ return true;
+ }
+
SVNRepository repository = null;
try {
repository = vcs.createRepository(url);
return info == null ? null : info.getURL();
}
- public static boolean doesRepositorySupportMergeInfo(final SvnVcs vcs, final SVNURL url) {
- SVNRepository repository = null;
- try {
- repository = vcs.createRepository(url);
- return repository.hasCapability(SVNCapability.MERGE_INFO);
- }
- catch (SVNException e) {
- return false;
- } finally {
- if (repository != null) {
- repository.closeSession();
- }
- }
- }
-
public static boolean remoteFolderIsEmpty(final SvnVcs vcs, final String url) throws SVNException {
// TODO: Implement with command line client
SVNRepository repository = null;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.openapi.wm.StatusBar;
import com.intellij.openapi.wm.WindowManager;
+import com.intellij.vcsUtil.VcsUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.idea.svn.SvnBundle;
import org.jetbrains.idea.svn.SvnStatusUtil;
import org.jetbrains.idea.svn.checkin.IdeaCommitHandler;
import org.jetbrains.idea.svn.commandLine.CommitEventHandler;
import org.jetbrains.idea.svn.dialogs.CreateBranchOrTagDialog;
+import org.jetbrains.idea.svn.update.AutoSvnUpdater;
+import org.jetbrains.idea.svn.update.SingleRootSwitcher;
import org.tmatesoft.svn.core.SVNErrorCode;
import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.SVNURL;
if (!exception.isNull()) {
throw new VcsException(exception.get());
}
+
+ if (dialog.isCopyFromWorkingCopy() && dialog.isSwitchOnCreate()) {
+ SingleRootSwitcher switcher =
+ new SingleRootSwitcher(project, VcsUtil.getFilePath(srcFile, srcFile.isDirectory()), dstSvnUrl.toDecodedString());
+
+ AutoSvnUpdater.run(switcher, SvnBundle.message("action.name.switch"));
+ }
}
}
package org.jetbrains.idea.svn.checkin;
import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.progress.ProcessCanceledException;
import com.intellij.openapi.progress.ProgressIndicator;
import com.intellij.openapi.util.Computable;
*/
public class IdeaCommitHandler implements CommitEventHandler, ISVNEventHandler {
+ private static final Logger LOG = Logger.getInstance(IdeaCommitHandler.class);
+
@Nullable private final ProgressIndicator myProgress;
@NotNull private final List<VirtualFile> myDeletedFiles = ContainerUtil.newArrayList();
private final boolean myCheckCancel;
@NotNull
private static CommitEventType convert(@NotNull SVNEventAction action) {
- CommitEventType result = null;
+ CommitEventType result = CommitEventType.unknown;
if (SVNEventAction.COMMIT_ADDED.equals(action)) {
result = CommitEventType.adding;
result = CommitEventType.transmittingDeltas;
} else if (SVNEventAction.SKIP.equals(action)) {
result = CommitEventType.skipped;
+ } else if (SVNEventAction.FAILED_OUT_OF_DATE.equals(action)) {
+ result = CommitEventType.failedOutOfDate;
}
- if (result == null) {
- throw new IllegalArgumentException("Unknown action " + action);
+ if (CommitEventType.unknown.equals(result)) {
+ LOG.warn("Could not create commit event from action " + action);
}
return result;
*/
package org.jetbrains.idea.svn.checkin;
-import com.intellij.ide.DataManager;
-import com.intellij.openapi.actionSystem.ActionManager;
-import com.intellij.openapi.actionSystem.ActionPlaces;
-import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.application.ModalityState;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vcs.update.ActionInfo;
import com.intellij.openapi.vfs.VfsUtil;
import com.intellij.openapi.vfs.VirtualFile;
-import com.intellij.openapi.wm.WindowManager;
import com.intellij.util.PairConsumer;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.*;
import org.jetbrains.idea.svn.update.AutoSvnUpdater;
-import javax.swing.*;
import java.io.File;
import java.util.ArrayList;
import java.util.Collection;
ApplicationManager.getApplication().invokeLater(new Runnable() {
@Override
public void run() {
- final JComponent frame = WindowManager.getInstance().getIdeFrame(project).getComponent();
- final AutoSvnUpdater updater = new AutoSvnUpdater(project, paths.toArray(new FilePath[paths.size()]));
- updater.getTemplatePresentation().setText(ActionInfo.UPDATE.getActionName());
- updater.actionPerformed(
- new AnActionEvent(null, DataManager.getInstance().getDataContext(frame), ActionPlaces.UNKNOWN,
- updater.getTemplatePresentation(), ActionManager.getInstance(), 0));
+ AutoSvnUpdater.run(new AutoSvnUpdater(project, paths.toArray(new FilePath[paths.size()])), ActionInfo.UPDATE.getActionName());
}
}, ModalityState.NON_MODAL);
}
package org.jetbrains.idea.svn.commandLine;
import com.intellij.execution.ExecutionException;
+import com.intellij.execution.configurations.EncodingEnvironmentUtil;
import com.intellij.execution.configurations.GeneralCommandLine;
import com.intellij.execution.process.*;
import com.intellij.openapi.diagnostic.Logger;
checkNotStarted();
try {
+ EncodingEnvironmentUtil.fixDefaultEncodingIfMac(myCommandLine, null);
+
myProcess = createProcess();
if (LOG.isDebugEnabled()) {
LOG.debug(myCommandLine.toString());
* Time: 6:51 PM
*/
public enum CommitEventType {
+ unknown("Unknown"),
adding("Adding"),
deleting("Deleting"),
sending("Sending"),
replacing("Replacing"),
transmittingDeltas("Transmitting file data"),
committedRevision("Committed revision"),
- skipped("Skipped");
+ skipped("Skipped"),
+ failedOutOfDate("Failed out of date");
private final String myText;
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="org.jetbrains.idea.svn.dialogs.CreateBranchOrTagDialog">
<grid id="9287c" binding="myTopPanel" layout-manager="GridBagLayout">
<constraints>
- <xy x="10" y="10" width="561" height="470"/>
+ <xy x="10" y="10" width="561" height="502"/>
</constraints>
<properties/>
<border type="none"/>
</component>
</children>
</scrollpane>
- <grid id="9317" layout-manager="GridLayoutManager" row-count="6" column-count="4" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+ <grid id="9317" layout-manager="GridLayoutManager" row-count="7" column-count="4" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="3" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</component>
<component id="27881" class="javax.swing.JRadioButton" binding="myRepositoryRadioButton" default-binding="true">
<constraints>
- <grid row="3" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+ <grid row="4" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="&Repository Location:"/>
</component>
<component id="d7ae0" class="com.intellij.openapi.ui.TextFieldWithBrowseButton" binding="myRepositoryField">
<constraints>
- <grid row="4" column="0" row-span="1" col-span="3" vsize-policy="0" hsize-policy="6" anchor="0" fill="3" indent="2" use-parent-layout="false"/>
+ <grid row="5" column="0" row-span="1" col-span="3" vsize-policy="0" hsize-policy="6" anchor="0" fill="3" indent="2" use-parent-layout="false"/>
</constraints>
<properties/>
</component>
<component id="675da" class="javax.swing.JLabel">
<constraints>
- <grid row="5" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
+ <grid row="6" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Re&vision:"/>
</component>
<nested-form id="23004" form-file="org/jetbrains/idea/svn/update/SvnRevisionPanel.form" binding="myRevisionPanel">
<constraints>
- <grid row="5" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
+ <grid row="6" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
</nested-form>
<hspacer id="b36ab">
<constraints>
- <grid row="5" column="2" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
+ <grid row="6" column="2" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
</hspacer>
<component id="13071" class="javax.swing.JButton" binding="myProjectButton">
<constraints>
- <grid row="4" column="3" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
+ <grid row="5" column="3" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<margin top="2" left="2" bottom="2" right="2"/>
<text resource-bundle="org/jetbrains/idea/svn/SvnBundle" key="dialog.create.branch.or.tag.from.working.copy.warning"/>
</properties>
</component>
+ <component id="ff73f" class="com.intellij.ui.components.JBCheckBox" binding="mySwitchOnCreate">
+ <constraints>
+ <grid row="3" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
+ </constraints>
+ <properties>
+ <margin top="0" left="-1" bottom="2" right="3"/>
+ <text resource-bundle="org/jetbrains/idea/svn/SvnBundle" key="create.branch.switch.on.create.title"/>
+ </properties>
+ </component>
</children>
</grid>
<grid id="a6551" layout-manager="GridLayoutManager" row-count="5" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.ui.ComboboxWithBrowseButton;
import com.intellij.ui.DocumentAdapter;
+import com.intellij.ui.components.JBCheckBox;
import com.intellij.util.ArrayUtil;
import com.intellij.util.ui.UIUtil;
import org.jetbrains.annotations.NonNls;
private JButton myProjectButton;
private JLabel myErrorLabel;
private JLabel myUseThisVariantToLabel;
+ private JBCheckBox mySwitchOnCreate;
@NonNls private static final String HELP_ID = "vcs.subversion.branch";
private SvnBranchConfigurationNew myBranchConfiguration;
private void updateControls() {
myWorkingCopyField.setEnabled(myWorkingCopyRadioButton.isSelected());
+ mySwitchOnCreate.setEnabled(myWorkingCopyRadioButton.isSelected());
myRepositoryField.setEnabled(myRepositoryRadioButton.isSelected());
myRevisionPanel.setEnabled(myRepositoryRadioButton.isSelected());
myProjectButton.setEnabled(myRepositoryRadioButton.isSelected());
public String getCopyFromUrl() {
return myRepositoryField.getText();
}
+
+ public boolean isSwitchOnCreate() {
+ return mySwitchOnCreate.isSelected();
+ }
}
@Override
public void run(ContinuationContext context) {
- try {
- final List<TaskDescriptor> tasks = new LinkedList<TaskDescriptor>();
- final boolean supportsMergeinfo = myWcInfo.getFormat().supportsMergeInfo() &&
- SvnUtil.doesRepositorySupportMergeInfo(myVcs, SVNURL.parseURIEncoded(mySourceUrl));
- if (! supportsMergeinfo) {
- insertMergeAll(tasks);
- } else {
- tasks.add(new MergeAllOrSelectedChooser());
- }
- context.next(tasks);
- }
- catch (SVNException e) {
- finishWithError(context, e.getMessage(), true);
+ final List<TaskDescriptor> tasks = new LinkedList<TaskDescriptor>();
+ final boolean supportsMergeinfo = myWcInfo.getFormat().supportsMergeInfo() && SvnUtil.checkRepositoryVersion15(myVcs, mySourceUrl);
+ if (! supportsMergeinfo) {
+ insertMergeAll(tasks);
+ } else {
+ tasks.add(new MergeAllOrSelectedChooser());
}
+ context.next(tasks);
}
}
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.openapi.vfs.VirtualFileManager;
+import com.intellij.ui.components.JBRadioButton;
import com.intellij.util.Consumer;
import com.intellij.util.SystemProperties;
import com.intellij.util.ui.UIUtil;
*/
public class SSHCredentialsDialog extends DialogWrapper implements ActionListener, DocumentListener {
private boolean myAllowSave;
+ private boolean myIsAgentAllowed;
private String myUserName;
private String myRealm;
private JPasswordField myPasswordText;
private JPasswordField myPassphraseText;
private TextFieldWithBrowseButton myKeyFileText;
+ private JBRadioButton mySshAgentButton;
private JRadioButton myPasswordButton;
private JRadioButton myKeyButton;
private JLabel myPasswordLabel;
@NonNls private static final String HELP_ID = "vcs.subversion.authentication";
private boolean myKeyFileEmptyOrCorrect;
- protected SSHCredentialsDialog(Project project, String realm, String userName, boolean allowSave, final int port) {
+ protected SSHCredentialsDialog(Project project,
+ String realm,
+ String userName,
+ boolean allowSave,
+ final int port,
+ boolean isAgentAllowed) {
super(project, true);
myProject = project;
myRealm = realm;
myUserName = userName;
myAllowSave = allowSave;
+ myIsAgentAllowed = isAgentAllowed;
setResizable(true);
getHelpAction().setEnabled(true);
init();
gb.gridx = 0;
gb.fill = GridBagConstraints.NONE;
gb.gridwidth = 3;
+
+ // ssh agent type
+ mySshAgentButton = new JBRadioButton(SvnBundle.message("radio.ssh.authentication.with.agent"));
+ panel.add(mySshAgentButton, gb);
+ gb.gridy += 1;
+ gb.weightx = 0;
+ gb.gridx = 0;
+ gb.fill = GridBagConstraints.NONE;
+ gb.gridwidth = 3;
+
// password type
myPasswordButton = new JRadioButton(SvnBundle.message("radio.ssh.authentication.with.password"));
panel.add(myPasswordButton, gb);
myPortField.getDocument().addDocumentListener(this);
ButtonGroup group = new ButtonGroup();
+ group.add(mySshAgentButton);
group.add(myPasswordButton);
group.add(myKeyButton);
- group.setSelected(myPasswordButton.getModel(), true);
- group.setSelected(myPasswordButton.getModel(), false);
+
+ mySshAgentButton.setEnabled(myIsAgentAllowed);
+ group.setSelected((myIsAgentAllowed ? mySshAgentButton : myPasswordButton).getModel(), true);
gb.gridy += 1;
gb.gridx = 0;
myAllowSaveCheckBox.setSelected(false);
myAllowSaveCheckBox.setEnabled(myAllowSave);
+ mySshAgentButton.addActionListener(this);
myKeyButton.addActionListener(this);
myPasswordButton.addActionListener(this);
else if (myKeyButton.isSelected()) {
if (! myKeyFileEmptyOrCorrect) return false;
ok = myKeyFileText != null && myKeyFileText.getText().trim().length() > 0;
+ }
+ else {
+ ok = mySshAgentButton.isSelected();
}
if (ok) {
String portNumber = myPortField.getText();
return ok;
}
+ public boolean isSshAgentSelected() {
+ return mySshAgentButton.isSelected();
+ }
+
public String getUserName() {
return isOK() && myUserNameText != null ? myUserNameText.getText() : null;
}
}
public void actionPerformed(ActionEvent e) {
- if (e.getSource() == myPasswordButton || e.getSource() == myKeyButton) {
+ if (e.getSource() == myPasswordButton || e.getSource() == myKeyButton || e.getSource() == mySshAgentButton) {
updateFields();
checkKeyFile();
updateOKButton();
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vcs.ui.VcsBalloonProblemNotifier;
import com.intellij.util.WaitForProgressToShow;
+import com.jcraft.jsch.agentproxy.AgentProxyException;
+import com.jcraft.jsch.agentproxy.Connector;
+import com.jcraft.jsch.agentproxy.ConnectorFactory;
+import com.jcraft.jsch.agentproxy.TrileadAgentProxy;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.SvnAuthenticationManager;
};
}
else if (ISVNAuthenticationManager.SSH.equals(kind)) {
+ // In current implementation, pageant connector available = operating system is Windows.
+ // So "ssh agent" option will be always available on Windows, even if pageant is not running.
+ final Connector agentConnector = createSshAgentConnector();
+ final boolean isAgentAvailable = agentConnector != null && agentConnector.isAvailable();
+
command = new Runnable() {
public void run() {
- SSHCredentialsDialog dialog = new SSHCredentialsDialog(myProject, realm, userName, authCredsOn, url.getPort());
+ SSHCredentialsDialog dialog = new SSHCredentialsDialog(myProject, realm, userName, authCredsOn, url.getPort(), isAgentAvailable);
setTitle(dialog, errorMessage);
dialog.show();
if (dialog.isOK()) {
int port = dialog.getPortNumber();
- if (dialog.getKeyFile() != null && dialog.getKeyFile().trim().length() > 0) {
+ if (dialog.isSshAgentSelected()) {
+ if (agentConnector != null) {
+ result[0] =
+ new SVNSSHAuthentication(dialog.getUserName(), new TrileadAgentProxy(agentConnector), port, url, false);
+ }
+ }
+ else if (dialog.getKeyFile() != null && dialog.getKeyFile().trim().length() > 0) {
String passphrase = dialog.getPassphrase();
if (passphrase != null && passphrase.length() == 0) {
passphrase = null;
}
result[0] =
- new SVNSSHAuthentication(dialog.getUserName(), new File(dialog.getKeyFile()), passphrase, port, dialog.isSaveAllowed(),
- url, false);
+ new SVNSSHAuthentication(dialog.getUserName(), new File(dialog.getKeyFile()), passphrase, port, dialog.isSaveAllowed(), url,
+ false);
}
else {
result[0] = new SVNSSHAuthentication(dialog.getUserName(), dialog.getPassword(), port, dialog.isSaveAllowed(), url, false);
return result[0];
}
+ @Nullable
+ private static Connector createSshAgentConnector() {
+ Connector result = null;
+
+ try {
+ result = ConnectorFactory.getDefault().createConnector();
+ }
+ catch (AgentProxyException e) {
+ LOG.info("Could not create ssh agent connector", e);
+ }
+
+ return result;
+ }
+
private static void setTitle(@NotNull DialogWrapper dialog, @Nullable SVNErrorMessage errorMessage) {
dialog.setTitle(errorMessage == null
? SvnBundle.message("dialog.title.authentication.required")
*/
package org.jetbrains.idea.svn.update;
+import com.intellij.ide.DataManager;
+import com.intellij.openapi.actionSystem.ActionManager;
+import com.intellij.openapi.actionSystem.ActionPlaces;
+import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.options.Configurable;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vcs.AbstractVcs;
import com.intellij.openapi.vcs.FilePath;
import com.intellij.openapi.vcs.actions.VcsContext;
import com.intellij.openapi.vcs.update.*;
+import com.intellij.openapi.wm.WindowManager;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.idea.svn.SvnConfiguration;
import org.jetbrains.idea.svn.SvnVcs;
import org.tmatesoft.svn.core.SVNDepth;
import org.tmatesoft.svn.core.wc.SVNRevision;
+import javax.swing.*;
import java.util.LinkedHashMap;
/**
myRoots = roots;
}
+ public static void run(@NotNull AutoSvnUpdater updater, @NotNull String title) {
+ JComponent frame = WindowManager.getInstance().getIdeFrame(updater.myProject).getComponent();
+
+ updater.getTemplatePresentation().setText(title);
+ updater.actionPerformed(
+ new AnActionEvent(null, DataManager.getInstance().getDataContext(frame), ActionPlaces.UNKNOWN, updater.getTemplatePresentation(),
+ ActionManager.getInstance(), 0)
+ );
+ }
+
@Override
protected void actionPerformed(VcsContext context) {
final SvnConfiguration configuration17 = SvnConfiguration.getInstance(myProject);
configuration17.setUpdateDepth(SVNDepth.INFINITY);
final SvnVcs vcs = SvnVcs.getInstance(myProject);
for (FilePath root : myRoots) {
- final UpdateRootInfo info = configuration17.getUpdateRootInfo(root.getIOFile(), vcs);
- info.setRevision(SVNRevision.HEAD);
- info.setUpdateToRevision(false);
+ configureUpdateRootInfo(root, configuration17.getUpdateRootInfo(root.getIOFile(), vcs));
}
super.actionPerformed(context);
}
+ protected void configureUpdateRootInfo(@NotNull FilePath root, @NotNull UpdateRootInfo info) {
+ info.setRevision(SVNRevision.HEAD);
+ info.setUpdateToRevision(false);
+ }
+
@Override
protected boolean filterRootsBeforeAction() {
return false;
--- /dev/null
+/*
+ * Copyright 2000-2014 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jetbrains.idea.svn.update;
+
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.vcs.FilePath;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author Konstantin Kolosovsky.
+ */
+public class SingleRootSwitcher extends AutoSvnUpdater {
+
+ @NotNull private String myUrl;
+
+ public SingleRootSwitcher(Project project, @NotNull FilePath root, @NotNull String url) {
+ super(project, new FilePath[]{root});
+
+ myUrl = url;
+ }
+
+ @Override
+ protected void configureUpdateRootInfo(@NotNull FilePath root, @NotNull UpdateRootInfo info) {
+ super.configureUpdateRootInfo(root, info);
+
+ info.setUrl(myUrl);
+ }
+}
</SOURCES>
</library>
</orderEntry>
+ <orderEntry type="library" name="jsch-agent-proxy" level="project" />
+ <orderEntry type="module-library">
+ <library name="trilead-ssh2">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/lib/trilead.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/lib/trileadsrc.zip!/trilead-ssh2/src/main/java" />
+ </SOURCES>
+ </library>
+ </orderEntry>
</component>
</module>
<root url="jar://$MODULE_DIR$/lib/trilead.jar!/" />
</CLASSES>
<JAVADOC />
- <SOURCES />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/lib/trileadsrc.zip!/trilead-ssh2/src/main/java" />
+ </SOURCES>
</library>
</orderEntry>
<orderEntry type="module" module-name="platform-impl" />
<orderEntry type="library" name="jna" level="project" />
<orderEntry type="library" name="pty4j" level="project" />
<orderEntry type="library" name="purejavacomm" level="project" />
+ <orderEntry type="library" name="jsch-agent-proxy" level="project" />
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/lib/jsch.agentproxy.svnkit-trilead-ssh2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
</component>
</module>