diff options
| author | Philipp Thun | 2011-02-01 11:55:33 +0000 |
|---|---|---|
| committer | Philipp Thun | 2011-02-01 11:55:33 +0000 |
| commit | 165279cc8f6c20e301cfc7170f4c4e67a6635fdf (patch) | |
| tree | cf672157d6477fd40763c342a5b26a1c26b850cf | |
| parent | 6ab22105fe2058dc566252cc44788bc37595aac8 (diff) | |
| download | egit-165279cc8f6c20e301cfc7170f4c4e67a6635fdf.tar.gz egit-165279cc8f6c20e301cfc7170f4c4e67a6635fdf.tar.xz egit-165279cc8f6c20e301cfc7170f4c4e67a6635fdf.zip | |
Add cheat sheet for push wizard
This change contains a cheat sheet for the push wizard.
Change-Id: Ie71f0e5d456ba8560d284cfc556cb61e53ab8380
Signed-off-by: Philipp Thun <philipp.thun@sap.com>
9 files changed, 126 insertions, 2 deletions
diff --git a/org.eclipse.egit.doc/cheatsheets/push.xml b/org.eclipse.egit.doc/cheatsheets/push.xml new file mode 100644 index 0000000000..505bcde166 --- /dev/null +++ b/org.eclipse.egit.doc/cheatsheets/push.xml @@ -0,0 +1,68 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Copyright (C) 2010, Philipp Thun <philipp.thun@sap.com> + + All rights reserved. This program and the accompanying materials + are made available under the terms of the Eclipse Public License v1.0 + which accompanies this distribution, and is available at + http://www.eclipse.org/legal/epl-v10.html +--> +<cheatsheet title="Pushing to another Git Repository"> + <intro> + <description> + With the Git Push Wizard you can push commits to another repository using different transport protocols. + </description> + </intro> + <item title="Start Push Wizard" dialog="true"> + <description> + The push wizard can be started from the context menu on a repository or project by "Push..." or "Team > Push...".<br /><br /> + <b>To start this cheat sheet from within the opened wizard, click the help icon and then select "Pushing to another Git Repository".</b> + </description> + </item> + <item + href="/org.eclipse.egit.doc/help/EGit/User_Guide/Tasks.html#Push_URI" + title="Destination Git Repository" dialog="true"> + <description> + <b>Select a push specification or enter the repository location.</b><br /><br /> + If you already configured a <b>push specification</b>, you can select it from the "Configured remote repository" drop-down list. Otherwise you have to specify the URI of a repository you want to push to as follows:<br /><br /> + If you have a <b>repository URI</b> in your clipboard, i.e. copied from a gitweb, github, wiki or any other page, it will be automatically entered into the URI field. The other fields (i.e. Host, Repository path, Protocol, Port) will then be automatically filled.<br /><br /> + In case pushing requires <b>authentication</b> (which is the most likely case), enter your credentials into the User and Password fields. + </description> + </item> + <item + href="/org.eclipse.egit.doc/help/EGit/User_Guide/User-Guide.html#Eclipse_SSH_Configuration" + title="Using SSH" skip="true" dialog="true"> + <description> + If you connect to the repository via SSH for the first time, you have to accept the <b>host key</b> of the repository before proceeding<br /><br /> + In case your SSH key is protected by a <b>passphrase</b>, you have to enter it in a dialog that opens automatically. + </description> + </item> + <item + href="/org.eclipse.egit.doc/help/EGit/User_Guide/Tasks.html#Push_Ref_Specifications" + title="Push Ref Specifications" dialog="true"> + <description> + <b>Specify reference mappings</b><br /><br /> + To map your local branch names to the same branch names that are available in the destination repository click "Add all branches spec".<br /><br /> + If you want to declare different mappings, either enter reference names into the "Source ref" and "Destination ref" fields or select an existing entry from the drop-down lists. Afterwards click "Add spec" to transfer the mapping into the "Specifications for push" list.<br /><br /> + A typical mapping is 'HEAD' as source reference and 'refs/heads/master' as destination reference. This means that the current HEAD (which points to the currently checked out branch) is mapped to the destination master branch.<br /><br /> + When pushing to a <b>Gerrit code review</b> system enter 'refs/for/master' as destination reference. This pushes the change to the review queue for the master branch. + </description> + </item> + <item + href="/org.eclipse.egit.doc/help/EGit/User_Guide/Tasks.html#Push_Confirmation" + title="Push Confirmation" dialog="true"> + <description> + <b>Confirm the push configuration</b><br /><br /> + A preview of all changes pushed to the destination repository is shown. The "Status" column contains '[new branch]' for references that will be newly created in the destination repository. For reference updates, the range of commits will be shown, i.e. the SHA1 of the first and the last commit to be pushed.<br /><br /> + <b>Click Finish.</b> + </description> + </item> + <item title="Push Results" dialog="true"> + <description> + The results page shows a list similar to the previous page and a confirmation message from the destination repository.<br /><br /> + In case of errors the error message from the destination repository is displayed as well.<br /><br /> + <b>Click Ok to end the wizard.</b> + </description> + <onCompletion>You have now successfully pushed to another Git repository.</onCompletion> + </item> +</cheatsheet> diff --git a/org.eclipse.egit.doc/contexts.xml b/org.eclipse.egit.doc/contexts.xml index 91c5986065..7e37b252bb 100644 --- a/org.eclipse.egit.doc/contexts.xml +++ b/org.eclipse.egit.doc/contexts.xml @@ -15,4 +15,10 @@ serialization="org.eclipse.ui.cheatsheets.openCheatSheet(cheatSheetId=org.eclipse.egit.cheatsheets.clone)" label="Cloning a Git Repository" /> </context> + <context id="PushWizard" title="Push To Another Repository"> + <description>To be guided through this wizard start the cheat sheet 'Pushing to another Git Repository' below.</description> + <command + serialization="org.eclipse.ui.cheatsheets.openCheatSheet(cheatSheetId=org.eclipse.egit.cheatsheets.push)" + label="Pushing to another Git Repository" /> + </context> </contexts> diff --git a/org.eclipse.egit.doc/plugin.properties b/org.eclipse.egit.doc/plugin.properties index dc37ee3071..d334e5e3b2 100644 --- a/org.eclipse.egit.doc/plugin.properties +++ b/org.eclipse.egit.doc/plugin.properties @@ -10,3 +10,5 @@ Bundle-Name = Git Team Provider Documentation (Incubation) cheatsheet.category = Team/Git cheatsheet.clone.name = Cloning a Git Repository cheatsheet.clone.desc = With the Git Clone Wizard you can clone repositories using different transport protocols. +cheatsheet.push.name = Pushing to another Git Repository +cheatsheet.push.desc = With the Git Push Wizard you can push commits to another repository using different transport protocols. diff --git a/org.eclipse.egit.doc/plugin.xml b/org.eclipse.egit.doc/plugin.xml index 01d0d4bc2d..ea371b74a3 100644 --- a/org.eclipse.egit.doc/plugin.xml +++ b/org.eclipse.egit.doc/plugin.xml @@ -37,6 +37,13 @@ contentFile="$nl$/cheatsheets/clone.xml"> <description>%cheatsheet.clone.desc</description> </cheatsheet> + <cheatsheet + name="%cheatsheet.push.name" + id="org.eclipse.egit.cheatsheets.push" + category="org.eclipse.egit.cheatsheets" + contentFile="$nl$/cheatsheets/push.xml"> + <description>%cheatsheet.push.desc</description> + </cheatsheet> </extension> <extension point="org.eclipse.help.contexts"> diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/PushActionHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/PushActionHandler.java index 72963c05d8..f127433b40 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/PushActionHandler.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/PushActionHandler.java @@ -44,7 +44,7 @@ public class PushActionHandler extends RepositoryActionHandler { return null; } WizardDialog dlg = new WizardDialog(getShell(event), pushWizard); - dlg.setHelpAvailable(false); + dlg.setHelpAvailable(true); dlg.open(); return null; } diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RefSpecPage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RefSpecPage.java index ebf7ba3a08..b8f1296681 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RefSpecPage.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RefSpecPage.java @@ -38,6 +38,7 @@ import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Group; +import org.eclipse.ui.PlatformUI; /** * This wizard page allows user easy selection of specifications for push or @@ -72,6 +73,8 @@ public class RefSpecPage extends WizardPage { private UserPasswordCredentials credentials; + private String helpContext = null; + /** * Create specifications selection page for provided context. * @@ -203,6 +206,21 @@ public class RefSpecPage extends WizardPage { return getRefSpecs().equals(specs); } + /** + * Set the ID for context sensitive help + * + * @param id + * help context + */ + public void setHelpContext(String id) { + helpContext = id; + } + + @Override + public void performHelp() { + PlatformUI.getWorkbench().getHelpSystem().displayHelp(helpContext); + } + private void revalidate() { if (currentRepoSelection != null diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/ConfirmationPage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/ConfirmationPage.java index 5d15c59399..b42a40bee4 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/ConfirmationPage.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/ConfirmationPage.java @@ -43,6 +43,7 @@ import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; +import org.eclipse.ui.PlatformUI; class ConfirmationPage extends WizardPage { static Collection<RemoteRefUpdate> copyUpdates( @@ -70,6 +71,8 @@ class ConfirmationPage extends WizardPage { private UserPasswordCredentials credentials; + private String helpContext = null; + public ConfirmationPage(final Repository local) { super(ConfirmationPage.class.getName()); this.local = local; @@ -107,6 +110,21 @@ class ConfirmationPage extends WizardPage { this.credentials = credentials; } + /** + * Set the ID for context sensitive help + * + * @param id + * help context + */ + public void setHelpContext(String id) { + helpContext = id; + } + + @Override + public void performHelp() { + PlatformUI.getWorkbench().getHelpSystem().displayHelp(helpContext); + } + boolean isConfirmed() { return confirmedResult != null; } diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/PushWizard.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/PushWizard.java index 8052697b08..0768e9a048 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/PushWizard.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/PushWizard.java @@ -54,6 +54,8 @@ import org.eclipse.ui.PlatformUI; * Push operation is performed upon successful completion of this wizard. */ public class PushWizard extends Wizard { + private static final String HELP_CONTEXT = "org.eclipse.egit.ui.PushWizard"; //$NON-NLS-1$ + private static String getURIsString(final Collection<URIish> uris) { final StringBuilder sb = new StringBuilder(); boolean first = true; @@ -88,6 +90,7 @@ public class PushWizard extends Wizard { final List<RemoteConfig> remotes = RemoteConfig .getAllRemoteConfigs(localDb.getConfig()); repoPage = new RepositorySelectionPage(false, remotes, null); + repoPage.setHelpContext(HELP_CONTEXT); refSpecPage = new RefSpecPage(localDb, true) { @Override public void setVisible(boolean visible) { @@ -98,6 +101,7 @@ public class PushWizard extends Wizard { super.setVisible(visible); } }; + refSpecPage.setHelpContext(HELP_CONTEXT); confirmPage = new ConfirmationPage(localDb) { @Override public void setVisible(boolean visible) { @@ -109,6 +113,7 @@ public class PushWizard extends Wizard { super.setVisible(visible); } }; + confirmPage.setHelpContext(HELP_CONTEXT); // TODO use/create another cool icon setDefaultPageImageDescriptor(UIIcons.WIZBAN_IMPORT_REPO); setNeedsProgressMonitor(true); diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/PushCommand.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/PushCommand.java index e580af1503..8bc5c32777 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/PushCommand.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/PushCommand.java @@ -29,7 +29,7 @@ public class PushCommand extends RepositoriesViewCommandHandler<RepositoryNode> try { WizardDialog dlg = new WizardDialog(getShell(event), new PushWizard(node.getRepository())); - dlg.setHelpAvailable(false); + dlg.setHelpAvailable(true); dlg.open(); } catch (URISyntaxException e1) { Activator.handleError(e1.getMessage(), e1, true); |
