Skip to content

Instantly share code, notes, and snippets.

@abhishekbh
Created April 24, 2012 20:31
Show Gist options
  • Save abhishekbh/2483487 to your computer and use it in GitHub Desktop.
Save abhishekbh/2483487 to your computer and use it in GitHub Desktop.
EGit Clean Command - Dialog diff
diff --git a/.project b/.project
new file mode 100644
index 0000000..50aa358
--- /dev/null
+++ b/.project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>egit</name>
+ <comment></comment>
+ <projects>
+ <project>com.google.protobuf</project>
+ <project>com.jcraft.jsch</project>
+ <project>javax.servlet</project>
+ <project>org.kohsuke.args4j</project>
+ <project>org.mockito</project>
+ <project>org.objenesis</project>
+ </projects>
+ <buildSpec>
+ </buildSpec>
+ <natures>
+ </natures>
+</projectDescription>
diff --git a/.settings/org.eclipse.ltk.core.refactoring.prefs b/.settings/org.eclipse.ltk.core.refactoring.prefs
new file mode 100644
index 0000000..5d0bfc7
--- /dev/null
+++ b/.settings/org.eclipse.ltk.core.refactoring.prefs
@@ -0,0 +1,3 @@
+#Thu Mar 22 08:03:18 EDT 2012
+eclipse.preferences.version=1
+org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/CleanOperation.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/CleanOperation.java
index 7379210..cec21ba 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/CleanOperation.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/CleanOperation.java
@@ -66,15 +66,12 @@ public void execute(IProgressMonitor monitor) throws CoreException {
// discover repositories and run clean on them
Repository repo = getRepository(resources[0]);
-/* if (repo == null)
- continue;*/
repoTree = new Git(repo);
- if (paths != null) {
+ if (paths != null)
repoTree.clean().setPaths(paths).call();
- } else {
+ else
repoTree.clean().call();
- }
}
/**
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CleanActionHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CleanActionHandler.java
index 6b9b6c9..e30a45e 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CleanActionHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CleanActionHandler.java
@@ -31,7 +31,7 @@
import org.eclipse.egit.ui.Activator;
/**
- * This operation cleans the repository
+ * This action handler cleans the repository
*
* @see CleanOperation
*/
@@ -60,15 +60,14 @@ public Object execute(ExecutionEvent event) throws ExecutionException {
// create dialog
ListSelectionDialog dialog = new ListSelectionDialog(
- getShell(event), // shell
- fileList, // set of file names to populate
- new ArrayContentProvider(), // acp
- new ItemLabelProvider(), // ilp
- UIText.CleanDialog_HeaderMessage // branch name
+ getShell(event), // shell
+ fileList, // set of file names to populate
+ new ArrayContentProvider(), // acp
+ new ItemLabelProvider(), // ilp
+ UIText.CleanDialog_HeaderMessage // branch name
);
dialog.setTitle(UIText.CleanDialog_TitleMessage);
- // if cancel clicked, return
if (dialog.open() != IDialogConstants.OK_ID)
return null;
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CleanTreeDialog.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CleanTreeDialog.java
index cb9e79b..2834912 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CleanTreeDialog.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CleanTreeDialog.java
@@ -53,9 +53,6 @@
*/
public class CleanTreeDialog extends TitleAreaDialog {
- /**
- * Button id for a "Clear" button (value 22).
- */
public static final int CLEAR_ID = 22;
private String branchName;
@@ -67,7 +64,7 @@
private Set<String> filesToBeDeleted;
/**
- * Construct dialog to creating or editing tag.
+ * Construct dialog for clean list.
*
* @param parent
* @param branchName
@@ -83,7 +80,7 @@ public CleanTreeDialog(Shell parent, String branchName, Repository repo, Set<Str
}
/**
- * Construct dialog to creating or editing tag.
+ * Construct dialog for clean list.
*
* @param parent
* @param commitId
@@ -96,13 +93,11 @@ public CleanTreeDialog(Shell parent, ObjectId commitId, Repository repo) {
setHelpAvailable(false);
}
- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
@Override
protected void configureShell(Shell newShell) {
super.configureShell(newShell);
newShell.setText(UIText.CreateTagDialog_NewTag);
- newShell.setMinimumSize(600, 400);
+ newShell.setMinimumSize(800, 600);
}
@Override
@@ -121,7 +116,7 @@ protected void createButtonsForButtonBar(Composite parent) {
@Override
public void create() {
super.create();
- // start a job that fills the tag list lazily
+ // start a job that fills the clean list lazily
Job job = new Job(UIText.CreateTagDialog_GetTagJobName) {
@Override
public boolean belongsTo(Object family) {
@@ -133,8 +128,6 @@ public boolean belongsTo(Object family) {
@Override
protected IStatus run(IProgressMonitor monitor) {
- // This is most likely the file list loading place
- //final List<Object> filesDelete = getCleanFileList();
PlatformUI.getWorkbench().getDisplay()
.asyncExec(new Runnable() {
public void run() {
@@ -187,7 +180,7 @@ protected void buttonPressed(int buttonId) {
break;
case IDialogConstants.OK_ID:
// read and store data from widgets
- //$FALL-THROUGH$ continue propagating OK button action
+ // $FALL-THROUGH$ continue propagating OK button action
default:
super.buttonPressed(buttonId);
}
@@ -253,7 +246,6 @@ private String getTitle() {
}
return title;
}
- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/**
* @param branchName the branchName to set
@@ -272,14 +264,14 @@ public String getBranchName() {
/**
* @param repo the repo to set
*/
- public void setRepo(Repository repo) {
- this.repo = repo;
+ public void setRepository(Repository repository) {
+ this.repo = repository;
}
/**
* @return the repo
*/
- public Repository getRepo() {
+ public Repository getRepository() {
return repo;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment