use of org.eclipse.egit.ui.internal.push.PushOperationUI in project egit by eclipse.
the class PushAction method runPushOperation.
private void runPushOperation() {
GitSynchronizeDataSet gsds = (GitSynchronizeDataSet) getConfiguration().getProperty(SYNCHRONIZATION_DATA);
for (GitSynchronizeData gsd : gsds) {
String remoteName = gsd.getDstRemoteName();
if (remoteName == null)
continue;
RemoteConfig rc;
Repository repo = gsd.getRepository();
StoredConfig config = repo.getConfig();
try {
rc = new RemoteConfig(config, remoteName);
} catch (URISyntaxException e) {
Activator.logError("Unable to create RemoteConfiguration for remote: " + remoteName, // $NON-NLS-1$
e);
continue;
}
if (rc.getPushRefSpecs().isEmpty())
// $NON-NLS-1$
rc.addPushRefSpec(new RefSpec(HEAD + ":" + gsd.getDstMerge()));
PushOperationUI push = new PushOperationUI(repo, rc, false);
push.setCredentialsProvider(new EGitCredentialsProvider());
push.start();
}
}
use of org.eclipse.egit.ui.internal.push.PushOperationUI in project egit by eclipse.
the class CommitJob method pushUpstream.
private void pushUpstream(final RevCommit commit, final PushMode pushTo) {
final RemoteConfig config = SimpleConfigurePushDialog.getConfiguredRemote(repository);
if (pushTo == PushMode.GERRIT || config == null) {
final Display display = PlatformUI.getWorkbench().getDisplay();
display.asyncExec(new Runnable() {
@Override
public void run() {
Wizard pushWizard = getPushWizard(commit, pushTo);
if (pushWizard != null) {
WizardDialog wizardDialog = new WizardDialog(display.getActiveShell(), pushWizard);
wizardDialog.setHelpAvailable(true);
wizardDialog.open();
}
}
});
} else {
PushOperationUI op = new PushOperationUI(repository, config.getName(), false);
op.start();
}
}
Aggregations