From d6368836d4ec1dbd8f912ce5d15f7ada5cf5f067 Mon Sep 17 00:00:00 2001 From: irengrig Date: Wed, 18 Jan 2012 15:11:13 +0400 Subject: [PATCH] IDEA-64841 "Use branch" disabled (SVN update file) - enable branch selection from update/integrate details - in order to Configure Branches be accessible --- .../idea/svn/update/SvnUpdateRootOptionsPanel.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/plugins/svn4ideaOld/src/org/jetbrains/idea/svn/update/SvnUpdateRootOptionsPanel.java b/plugins/svn4ideaOld/src/org/jetbrains/idea/svn/update/SvnUpdateRootOptionsPanel.java index 4ec8a5da4a71..d232fdc3037f 100644 --- a/plugins/svn4ideaOld/src/org/jetbrains/idea/svn/update/SvnUpdateRootOptionsPanel.java +++ b/plugins/svn4ideaOld/src/org/jetbrains/idea/svn/update/SvnUpdateRootOptionsPanel.java @@ -83,7 +83,7 @@ public class SvnUpdateRootOptionsPanel implements SvnPanel{ public void actionPerformed(ActionEvent e) { if (myUpdateToSpecificUrl.isSelected()) { myURLText.setEnabled(true); - myBranchField.setEnabled((myBranchUrl != null) && (mySourceUrl != null)); + myBranchField.setEnabled(mySourceUrl != null); //chooseBranch(); } else { myURLText.setEnabled(false); @@ -123,7 +123,7 @@ public class SvnUpdateRootOptionsPanel implements SvnPanel{ myRevisionText.getTextField().selectAll(); myRevisionText.setEnabled(myRevisionBox.isSelected()); myURLText.setEnabled(myUpdateToSpecificUrl.isSelected()); - myBranchField.setEnabled(myUpdateToSpecificUrl.isSelected() && (myBranchUrl != null) && (mySourceUrl != null)); + myBranchField.setEnabled(myUpdateToSpecificUrl.isSelected() && (mySourceUrl != null)); final boolean revisionCanBeSpecifiedForRoot = (! myIsNested) || isRevisionCanBeSpecifiedForRoot(); myRevisionBox.setEnabled(revisionCanBeSpecifiedForRoot); @@ -146,12 +146,18 @@ public class SvnUpdateRootOptionsPanel implements SvnPanel{ } private void chooseBranch() { - if ((myBranchUrl == null) || (mySourceUrl == null)) { + if (mySourceUrl == null) { myBranchField.setEnabled(false); return; } SelectBranchPopup.show(myVcs.getProject(), myRoot.getVirtualFile(), new SelectBranchPopup.BranchSelectedCallback() { public void branchSelected(final Project project, final SvnBranchConfigurationNew configuration, final String url, final long revision) { + // try to re-init branch url + myBranchUrl = getBranchForUrl(mySourceUrl); + if (myBranchUrl == null) { + myBranchField.setText(""); + return; + } recalculateUrl(url); myBranchField.setText(SVNPathUtil.tail(url)); } @@ -205,7 +211,7 @@ public class SvnUpdateRootOptionsPanel implements SvnPanel{ myUpdateToSpecificUrl.setSelected(false); myRevisionText.setEnabled(myRevisionBox.isSelected()); myURLText.setEnabled(myUpdateToSpecificUrl.isSelected()); - myBranchField.setEnabled(myUpdateToSpecificUrl.isSelected() && (myBranchUrl != null) && (mySourceUrl != null)); + myBranchField.setEnabled(myUpdateToSpecificUrl.isSelected() && (mySourceUrl != null)); } public void apply(final SvnConfiguration configuration) throws ConfigurationException {