use of org.eclipse.egit.ui.internal.push.PushBranchWizard in project egit by eclipse.
the class PushUpstreamOrBranchActionHandler method pushOrConfigure.
/**
* @param repository
* @param config
* @param shell
*/
public static void pushOrConfigure(final Repository repository, RemoteConfig config, Shell shell) {
if (config != null) {
PushOperationUI op = new PushOperationUI(repository, config.getName(), false);
op.start();
} else {
Ref head = getHeadIfSymbolic(repository);
if (head != null) {
PushBranchWizard pushBranchWizard = new PushBranchWizard(repository, head);
PushWizardDialog dlg = new PushWizardDialog(shell, pushBranchWizard);
dlg.open();
}
}
}
use of org.eclipse.egit.ui.internal.push.PushBranchWizard in project egit by eclipse.
the class PushBranchActionHandler method execute.
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
Repository repository = getRepository(true, event);
try {
PushBranchWizard wizard = null;
Ref ref = getBranchRef(repository);
if (ref != null) {
wizard = new PushBranchWizard(repository, ref);
} else {
ObjectId id = repository.resolve(repository.getFullBranch());
wizard = new PushBranchWizard(repository, id);
}
PushWizardDialog dlg = new PushWizardDialog(getShell(event), wizard);
dlg.open();
} catch (IOException ex) {
Activator.handleError(ex.getLocalizedMessage(), ex, false);
}
return null;
}
use of org.eclipse.egit.ui.internal.push.PushBranchWizard in project egit by eclipse.
the class PushCommitHandler method execute.
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
PlotCommit commit = (PlotCommit) getSelection(event).getFirstElement();
final Repository repo = getRepository(event);
try {
PushBranchWizard wizard = null;
Ref localBranch = null;
for (int i = 0; i < commit.getRefCount(); i++) {
Ref currentRef = commit.getRef(i);
if (localBranch == null && currentRef.getName().startsWith(Constants.R_HEADS))
localBranch = currentRef;
}
if (localBranch == null)
wizard = new PushBranchWizard(repo, commit.getId());
else
wizard = new PushBranchWizard(repo, localBranch);
PushWizardDialog dlg = new PushWizardDialog(HandlerUtil.getActiveShellChecked(event), wizard);
dlg.setHelpAvailable(true);
dlg.open();
} catch (Exception e) {
Activator.handleError(e.getMessage(), e, true);
}
return null;
}
use of org.eclipse.egit.ui.internal.push.PushBranchWizard in project egit by eclipse.
the class PushCommand method execute.
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
List<RepositoryTreeNode> nodes = getSelectedNodes(event);
RepositoryTreeNode node = nodes.get(0);
IWizard pushWiz = null;
try {
switch(node.getType()) {
case REF:
Ref ref = (Ref) node.getObject();
pushWiz = new PushBranchWizard(node.getRepository(), ref);
break;
case TAG:
pushWiz = createPushTagsWizard(nodes);
break;
case REPO:
pushWiz = new PushWizard(node.getRepository());
break;
default:
// $NON-NLS-1$
throw new UnsupportedOperationException("type not supported!");
}
} catch (URISyntaxException e1) {
Activator.handleError(e1.getMessage(), e1, true);
return null;
}
WizardDialog dlg = new PushWizardDialog(getShell(event), pushWiz);
dlg.setHelpAvailable(pushWiz.isHelpAvailable());
dlg.open();
return null;
}
Aggregations