summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorMarkus Duft2012-10-09 04:32:21 (EDT)
committer Matthias Sohn2012-10-24 18:22:34 (EDT)
commitcb5822257614b5d6b814d5d43c6b5193aeb87637 (patch)
treeeeb9438e0817be8b3ae255583c5ebb0346ec51be
parent33108de73badd0f8fda83e29c4a2f23387fd7f88 (diff)
downloadegit-cb5822257614b5d6b814d5d43c6b5193aeb87637.zip
egit-cb5822257614b5d6b814d5d43c6b5193aeb87637.tar.gz
egit-cb5822257614b5d6b814d5d43c6b5193aeb87637.tar.bz2
Allow "Push to Gerrit..." to push to refs/drafts/...refs/changes/94/8094/2
This change replaces the label displaying the "refs/for/" prefix by a Combo which allows to select different types of prefixes for Gerrit. Currently the classic "refs/for/" and the "refs/drafts/" prefixes are available, but more could be added easily. Change-Id: Id4125ca71bd7a3ebf1fb97ddaa2eb7094f030192 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/PushToGerritPage.java14
1 files changed, 9 insertions, 5 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/PushToGerritPage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/PushToGerritPage.java
index 50054ef..43b50b7 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/PushToGerritPage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/PushToGerritPage.java
@@ -78,6 +78,8 @@ class PushToGerritPage extends WizardPage {
private Combo uriCombo;
+ private Combo prefixCombo;
+
private Label branchTextlabel;
private Text branchText;
@@ -121,9 +123,10 @@ class PushToGerritPage extends WizardPage {
branchTextlabel = new Label(main, SWT.NONE);
// we visualize the prefix here
- Text prefix = new Text(main, SWT.NONE);
- prefix.setText("refs/for/"); //$NON-NLS-1$
- prefix.setEnabled(false);
+ prefixCombo = new Combo(main, SWT.READ_ONLY | SWT.DROP_DOWN);
+ prefixCombo.add("refs/for/"); //$NON-NLS-1$
+ prefixCombo.add("refs/drafts/"); //$NON-NLS-1$
+ prefixCombo.select(0);
branchTextlabel.setText(UIText.PushToGerritPage_BranchLabel);
branchText = new Text(main, SWT.SINGLE | SWT.BORDER);
@@ -216,8 +219,9 @@ class PushToGerritPage extends WizardPage {
URIish uri = new URIish(uriCombo.getText());
Ref currentHead = repository.getRef(Constants.HEAD);
RemoteRefUpdate update = new RemoteRefUpdate(repository,
- currentHead,
- "refs/for/" + branchText.getText(), false, null, null); //$NON-NLS-1$
+ currentHead, prefixCombo.getItem(prefixCombo
+ .getSelectionIndex()) + branchText.getText(),
+ false, null, null);
PushOperationSpecification spec = new PushOperationSpecification();
spec.addURIRefUpdates(uri, Arrays.asList(update));