Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjames2002-01-28 19:10:48 +0000
committerjames2002-01-28 19:10:48 +0000
commitc91e6d726073a142e36ff08cbbf4500629813158 (patch)
tree2a7bf77352f2899c4c532ec2d219a7ed1c3693fc
parent648da81163917bedbc51b72aff86841c8f022715 (diff)
downloadeclipse.platform.team-c91e6d726073a142e36ff08cbbf4500629813158.tar.gz
eclipse.platform.team-c91e6d726073a142e36ff08cbbf4500629813158.tar.xz
eclipse.platform.team-c91e6d726073a142e36ff08cbbf4500629813158.zip
8185: Branch should automatically version
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties2
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/BranchWizard.java10
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/BranchWizardPage.java81
3 files changed, 77 insertions, 16 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties
index c84640301..8ccbede43 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties
@@ -21,6 +21,8 @@ BranchWizard.errorTagging=Error Tagging Resources
BranchWizardPage.description=Enter the name of the branch tag to create, and specify whether you wish to begin working in the branch.\n\nIf you choose to begin working in the branch, your selected workspace resources will be updated to point to the new branch.
BranchWizardPage.branchName=Branch Name:
BranchWizardPage.startWorking=Start working in the branch
+BranchWizardPage.specifyVersion=Version the project before creating the branch
+BranchWizardPage.versionName=Version Name:
CVSCatchupReleaseViewer.checkIn=&Check In
CVSCatchupReleaseViewer.commonFile=Common file: {0}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/BranchWizard.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/BranchWizard.java
index 7ac1be428..cfbee3674 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/BranchWizard.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/BranchWizard.java
@@ -46,8 +46,13 @@ public class BranchWizard extends Wizard {
getContainer().run(false, false, new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) {
try {
- String tagString = mainPage.getTag();
+ String tagString = mainPage.getBranchTag();
boolean update = mainPage.getUpdate();
+ String versionString = mainPage.getVersionTag();
+ CVSTag versionTag = null;
+ if (versionString != null) {
+ versionTag = new CVSTag(versionString, CVSTag.VERSION);
+ }
// To do: use the wizard's progress monitor
Hashtable table = getProviderMapping(resources);
@@ -62,6 +67,9 @@ public class BranchWizard extends Wizard {
IResource[] providerResources = (IResource[])list.toArray(new IResource[list.size()]);
CVSTag tag = new CVSTag(tagString, CVSTag.BRANCH);
try {
+ if (versionString != null) {
+ provider.tag(providerResources, IResource.DEPTH_INFINITE, versionTag, subMonitor);
+ }
provider.tag(providerResources, IResource.DEPTH_INFINITE, tag, subMonitor);
if (update) {
provider.update(providerResources, IResource.DEPTH_INFINITE, tag, true, subMonitor);
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/BranchWizardPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/BranchWizardPage.java
index 501f91439..f199e039c 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/BranchWizardPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/BranchWizardPage.java
@@ -21,7 +21,12 @@ import org.eclipse.team.internal.ccvs.ui.Policy;
public class BranchWizardPage extends CVSWizardPage {
boolean update;
- String tag;
+ String branchTag;
+ String versionTag;
+ boolean doVersion;
+
+ Text versionText;
+ Text branchText;
public BranchWizardPage(String pageName, String title, ImageDescriptor titleImage) {
super(pageName, title, titleImage);
@@ -43,20 +48,11 @@ public class BranchWizardPage extends CVSWizardPage {
createLabel(composite, "");
createLabel(composite, Policy.bind("BranchWizardPage.branchName"));
- final Text branchText = createTextField(composite);
+ branchText = createTextField(composite);
branchText.addListener(SWT.Modify, new Listener() {
public void handleEvent(Event event) {
- String text = branchText.getText();
- IStatus status = CVSTag.validateTagName(branchText.getText());
- if (status.isOK()) {
- setErrorMessage(null);
- tag = text;
- setPageComplete(true);
- } else {
- setErrorMessage(status.getMessage());
- tag = null;
- setPageComplete(false);
- }
+ branchTag = branchText.getText();
+ updateEnablement();
}
});
@@ -76,12 +72,67 @@ public class BranchWizardPage extends CVSWizardPage {
check.setSelection(true);
update = true;
+ createLabel(composite, "");
+ createLabel(composite, "");
+
+ final Button specifyVersion = new Button(composite, SWT.CHECK);
+ data = new GridData();
+ data.horizontalSpan = 2;
+ specifyVersion.setLayoutData(data);
+ specifyVersion.setText(Policy.bind("BranchWizardPage.specifyVersion"));
+ specifyVersion.setSelection(true);
+ doVersion = true;
+
+ createLabel(composite, Policy.bind("BranchWizardPage.versionName"));
+ versionText = createTextField(composite);
+ versionText.addListener(SWT.Modify, new Listener() {
+ public void handleEvent(Event event) {
+ versionTag = versionText.getText();
+ updateEnablement();
+ }
+ });
+ specifyVersion.addListener(SWT.Selection, new Listener() {
+ public void handleEvent(Event event) {
+ doVersion = specifyVersion.getSelection();
+ versionText.setEnabled(doVersion);
+ }
+ });
+
setControl(composite);
}
- public String getTag() {
- return tag;
+ public String getBranchTag() {
+ return branchTag;
}
public boolean getUpdate() {
return update;
}
+ public String getVersionTag() {
+ if (doVersion) {
+ return versionTag;
+ } else {
+ return null;
+ }
+ }
+ private void updateEnablement() {
+ IStatus status = CVSTag.validateTagName(branchText.getText());
+ if (status.isOK()) {
+ setErrorMessage(null);
+ } else {
+ setErrorMessage(status.getMessage());
+ setPageComplete(false);
+ return;
+ }
+
+ if (doVersion) {
+ status = CVSTag.validateTagName(versionText.getText());
+ if (status.isOK()) {
+ setErrorMessage(null);
+ } else {
+ setErrorMessage(status.getMessage());
+ setPageComplete(false);
+ return;
+ }
+ }
+ setPageComplete(true);
+ }
}

Back to the top