[EGIT PATCH] Add an action to set quickdiff baseline to first parent of HEAD

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is useful when reviewing code.

Signed-off-by: Robin Rosenberg <robin.rosenberg@xxxxxxxxxx>
---
 org.spearce.egit.ui/plugin.xml                     |    7 +++++
 .../actions/ResetQuickdiffBaselineAction.java      |    2 +-
 .../ResetQuickdiffBaselineHeadParentAction.java    |   24 ++++++++++++++++++++
 3 files changed, 32 insertions(+), 1 deletions(-)
 create mode 100644 org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/ResetQuickdiffBaselineHeadParentAction.java

diff --git a/org.spearce.egit.ui/plugin.xml b/org.spearce.egit.ui/plugin.xml
index 55207eb..2472c9b 100644
--- a/org.spearce.egit.ui/plugin.xml
+++ b/org.spearce.egit.ui/plugin.xml
@@ -150,6 +150,13 @@
 	       label="Reset quickdiff baseline to HEAD"
 	       menubarPath="additions">
 	 </action>
+	 <action
+	       class="org.spearce.egit.ui.internal.actions.ResetQuickdiffBaselineHeadParentAction"
+	       enablesFor="*"
+	       id="org.spearce.egit.ui.resetquickdiffheadparentbaseline"
+	       label="Reset quickdiff baseline to first parent of HEAD"
+	       menubarPath="additions">
+	 </action>
 	  </objectContribution>
    </extension>
 
diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/ResetQuickdiffBaselineAction.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/ResetQuickdiffBaselineAction.java
index a42635a..597ee10 100644
--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/ResetQuickdiffBaselineAction.java
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/ResetQuickdiffBaselineAction.java
@@ -13,7 +13,7 @@
 import org.eclipse.jface.action.IAction;
 
 /**
- * Changes the reference for the quickdiff
+ * Changes the reference for the quickdiff to HEAD
  */
 public class ResetQuickdiffBaselineAction extends AbstractRevObjectAction {
 
diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/ResetQuickdiffBaselineHeadParentAction.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/ResetQuickdiffBaselineHeadParentAction.java
new file mode 100644
index 0000000..85a9998
--- /dev/null
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/ResetQuickdiffBaselineHeadParentAction.java
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@xxxxxxxxxx>
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * See LICENSE for the full license text, also available.
+ *******************************************************************************/
+package org.spearce.egit.ui.internal.actions;
+
+import java.util.List;
+
+import org.eclipse.core.resources.IWorkspaceRunnable;
+import org.eclipse.jface.action.IAction;
+
+/**
+ * Changes the reference for the quickdiff to the (first) parent of HEAD
+ */
+public class ResetQuickdiffBaselineHeadParentAction extends AbstractRevObjectAction {
+
+	@Override
+	protected IWorkspaceRunnable createOperation(IAction act, List selection) {
+		return new QuickdiffBaselineOperation(getActiveRepository(), "HEAD^1");
+	}
+}
-- 
1.6.0.1.161.g7f314

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux