diff options
| author | Markus Duft | 2012-10-09 08:32:21 +0000 |
|---|---|---|
| committer | Matthias Sohn | 2012-10-24 22:22:34 +0000 |
| commit | cb5822257614b5d6b814d5d43c6b5193aeb87637 (patch) | |
| tree | eeb9438e0817be8b3ae255583c5ebb0346ec51be | |
| parent | 33108de73badd0f8fda83e29c4a2f23387fd7f88 (diff) | |
| download | egit-cb5822257614b5d6b814d5d43c6b5193aeb87637.tar.gz egit-cb5822257614b5d6b814d5d43c6b5193aeb87637.tar.xz egit-cb5822257614b5d6b814d5d43c6b5193aeb87637.zip | |
Allow "Push to Gerrit..." to push to refs/drafts/...
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.java | 14 |
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 50054ef131..43b50b705c 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)); |
