Author: adietish
Date: 2011-10-11 06:07:51 -0400 (Tue, 11 Oct 2011)
New Revision: 35530
Modified:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationWizardPage.java
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ServerAdapterWizardModel.java
Log:
[JBIDE-9793] cloning openshift repo (finally managed to get cloned repo added to repo
view)
Modified:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationWizardPage.java
===================================================================
---
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationWizardPage.java 2011-10-11
09:17:58 UTC (rev 35529)
+++
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationWizardPage.java 2011-10-11
10:07:51 UTC (rev 35530)
@@ -171,18 +171,18 @@
cell.setText(application.getCartridge().getName());
}
}, viewer, tableLayout);
- createTableColumn("URL", 3, new CellLabelProvider() {
-
- @Override
- public void update(ViewerCell cell) {
- try {
- IApplication application = (IApplication) cell.getElement();
- cell.setText(application.getApplicationUrl());
- } catch (OpenshiftException e) {
- // ignore
- }
- }
- }, viewer, tableLayout);
+// createTableColumn("URL", 3, new CellLabelProvider() {
+//
+// @Override
+// public void update(ViewerCell cell) {
+// try {
+// IApplication application = (IApplication) cell.getElement();
+// cell.setText(application.getApplicationUrl());
+// } catch (OpenshiftException e) {
+// // ignore
+// }
+// }
+// }, viewer, tableLayout);
return viewer;
}
Modified:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ServerAdapterWizardModel.java
===================================================================
---
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ServerAdapterWizardModel.java 2011-10-11
09:17:58 UTC (rev 35529)
+++
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ServerAdapterWizardModel.java 2011-10-11
10:07:51 UTC (rev 35530)
@@ -19,6 +19,7 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.egit.core.op.CloneOperation;
+import org.eclipse.egit.ui.Activator;
import org.eclipse.jgit.api.Git;
import org.eclipse.jgit.api.InitCommand;
import org.eclipse.jgit.api.errors.CheckoutConflictException;
@@ -66,16 +67,18 @@
public void setupProject() throws OpenshiftException, URISyntaxException,
InvocationTargetException, InterruptedException, IOException, NoHeadException,
ConcurrentRefUpdateException, CheckoutConflictException, InvalidMergeHeadsException,
WrongRepositoryStateException, NoMessageException, CoreException {
String applicationWorkingdir = "openshift-" + application.getName();
// File workspace = ResourcesPlugin.getWorkspace().getRoot().getLocation().toFile();
- String userHome = System.getProperty("user.home");
+ String userHome = System.getProperty("java.io.tmpdir");
// File workDir = new File(workspace, applicationWorkingdir);
- File workDir = new File(userHome, applicationWorkingdir);
+ File clonedDirectory = new File(userHome, applicationWorkingdir);
URIish gitUri = new URIish(application.getGitUri());
- if (workDir.exists()) {
- FileUtil.completeDelete(workDir);
+ if (clonedDirectory.exists()) {
+ FileUtil.completeDelete(clonedDirectory);
}
- CloneOperation cloneOperation = new CloneOperation(gitUri, true, null, workDir,
"refs/heads/*", "master", 10 * 1024);
+ CloneOperation cloneOperation = new CloneOperation(gitUri, true, null, clonedDirectory,
Constants.HEAD, "origin", 10 * 1024);
// cloneOperation.setCredentialsProvider(new
UsernamePasswordCredentialsProvider(user.getRhlogin(), user.getPassword()));
cloneOperation.run(null);
+ File gitDirectory = new File(clonedDirectory, Constants.DOT_GIT);
+ Activator.getDefault().getRepositoryUtil().addConfiguredRepository(gitDirectory);
// File repositoryFile = createRepositoryFile(applicationWorkingdir);
// Git git = createGit(repositoryFile);
// TODO replace remote name by user setting