[EGIT PATCH 3/4] Switch usage of AnyObjectId.toString() to new AnyObjectId.name() in Eclipse plugin

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

 



Signed-off-by: Robin Rosenberg <robin.rosenberg@xxxxxxxxxx>
---
 .../core/internal/storage/CommitFileRevision.java  |    2 +-
 .../actions/HardResetToRevisionAction.java         |    6 ++++--
 .../actions/MixedResetToRevisionAction.java        |    6 ++++--
 .../actions/SetQuickdiffBaselineAction.java        |    2 +-
 .../actions/SoftResetToRevisionAction.java         |    6 ++++--
 .../egit/ui/internal/components/RefSpecPanel.java  |    2 +-
 .../egit/ui/internal/history/CommitGraphTable.java |    2 +-
 .../ui/internal/history/CommitMessageViewer.java   |    4 ++--
 .../ui/internal/history/FindToolbarThread.java     |    2 +-
 9 files changed, 19 insertions(+), 13 deletions(-)

diff --git a/org.spearce.egit.core/src/org/spearce/egit/core/internal/storage/CommitFileRevision.java b/org.spearce.egit.core/src/org/spearce/egit/core/internal/storage/CommitFileRevision.java
index 58d4801..e364027 100644
--- a/org.spearce.egit.core/src/org/spearce/egit/core/internal/storage/CommitFileRevision.java
+++ b/org.spearce.egit.core/src/org/spearce/egit/core/internal/storage/CommitFileRevision.java
@@ -76,7 +76,7 @@ public long getTimestamp() {
 	}
 
 	public String getContentIdentifier() {
-		return commit.getId().toString();
+		return commit.getId().name();
 	}
 
 	public String getAuthor() {
diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/HardResetToRevisionAction.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/HardResetToRevisionAction.java
index 78fd87f..f787e38 100644
--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/HardResetToRevisionAction.java
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/HardResetToRevisionAction.java
@@ -12,6 +12,7 @@
 import org.eclipse.core.resources.IWorkspaceRunnable;
 import org.eclipse.jface.action.IAction;
 import org.spearce.egit.core.op.ResetOperation;
+import org.spearce.jgit.lib.AnyObjectId;
 
 /**
  * Hard reset to selected revision
@@ -20,7 +21,8 @@
 
 	@Override
 	protected IWorkspaceRunnable createOperation(IAction act, List selection) {
-		return new ResetOperation(getActiveRepository(), selection.get(0)
-				.toString(), ResetOperation.ResetType.HARD);
+		return new ResetOperation(getActiveRepository(),
+				((AnyObjectId) selection.get(0)).name(),
+				ResetOperation.ResetType.HARD);
 	}
 }
diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/MixedResetToRevisionAction.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/MixedResetToRevisionAction.java
index 6e4a9bf..9d8bde0 100644
--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/MixedResetToRevisionAction.java
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/MixedResetToRevisionAction.java
@@ -12,6 +12,7 @@
 import org.eclipse.core.resources.IWorkspaceRunnable;
 import org.eclipse.jface.action.IAction;
 import org.spearce.egit.core.op.ResetOperation;
+import org.spearce.jgit.lib.AnyObjectId;
 
 /**
  * Mixed reset to selected revision
@@ -20,7 +21,8 @@
 
 	@Override
 	protected IWorkspaceRunnable createOperation(IAction act, List selection) {
-		return new ResetOperation(getActiveRepository(), selection.get(0)
-				.toString(), ResetOperation.ResetType.MIXED);
+		return new ResetOperation(getActiveRepository(),
+				((AnyObjectId) selection.get(0)).name(),
+				ResetOperation.ResetType.MIXED);
 	}
 }
diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/SetQuickdiffBaselineAction.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/SetQuickdiffBaselineAction.java
index 05686cf..b5ac2b8 100644
--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/SetQuickdiffBaselineAction.java
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/SetQuickdiffBaselineAction.java
@@ -20,7 +20,7 @@
 
 	@Override
 	protected IWorkspaceRunnable createOperation(IAction act, List selection) {
-		return new QuickdiffBaselineOperation(getActiveRepository(), ((RevObject)selection.get(0)).getId().toString());
+		return new QuickdiffBaselineOperation(getActiveRepository(), ((RevObject)selection.get(0)).getId().name());
 	}
 
 }
diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/SoftResetToRevisionAction.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/SoftResetToRevisionAction.java
index 7abbc92..7d7ff7a 100644
--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/SoftResetToRevisionAction.java
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/SoftResetToRevisionAction.java
@@ -12,6 +12,7 @@
 import org.eclipse.core.resources.IWorkspaceRunnable;
 import org.eclipse.jface.action.IAction;
 import org.spearce.egit.core.op.ResetOperation;
+import org.spearce.jgit.lib.AnyObjectId;
 
 /**
  * Soft reset to selected revision
@@ -20,7 +21,8 @@
 
 	@Override
 	protected IWorkspaceRunnable createOperation(IAction act, List selection) {
-		return new ResetOperation(getActiveRepository(), selection.get(0)
-				.toString(), ResetOperation.ResetType.SOFT);
+		return new ResetOperation(getActiveRepository(),
+				((AnyObjectId) selection.get(0)).name(),
+				ResetOperation.ResetType.SOFT);
 	}
 }
diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/components/RefSpecPanel.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/components/RefSpecPanel.java
index a2661ae..a5a9529 100644
--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/components/RefSpecPanel.java
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/components/RefSpecPanel.java
@@ -1095,7 +1095,7 @@ protected Object getValue(final Object element) {
 			@Override
 			protected void setValue(final Object element, final Object value) {
 				if (value == null || ((String) value).length() == 0
-						|| ObjectId.zeroId().toString().equals(value)) {
+						|| ObjectId.zeroId().name().equals(value)) {
 					// Ignore empty strings or null objects - do not set them in
 					// model.User won't loose any information if we just fall
 					// back to the old value.
diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/CommitGraphTable.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/CommitGraphTable.java
index 478f0b5..a28e3c4 100644
--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/CommitGraphTable.java
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/CommitGraphTable.java
@@ -146,7 +146,7 @@ void doCopy() {
 			final PlotCommit d = itr.next();
 			if (r.length() > 0)
 				r.append("\n");
-			r.append(d.getId().toString());
+			r.append(d.getId().name());
 		}
 
 		clipboard.setContents(new Object[] { r.toString() },
diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/CommitMessageViewer.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/CommitMessageViewer.java
index 108aca9..76d57bd 100644
--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/CommitMessageViewer.java
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/CommitMessageViewer.java
@@ -130,7 +130,7 @@ private void format() {
 		final ArrayList<StyleRange> styles = new ArrayList<StyleRange>();
 
 		d.append("commit ");
-		d.append(commit.getId());
+		d.append(commit.getId().name());
 		d.append("\n");
 
 		if (author != null) {
@@ -221,7 +221,7 @@ private void addLink(final StringBuilder d,
 		sr.foreground = sys_linkColor;
 		sr.underline = true;
 		sr.start = d.length();
-		d.append(to.getId().toString());
+		d.append(to.getId().name());
 		sr.length = d.length() - sr.start;
 		styles.add(sr);
 	}
diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/FindToolbarThread.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/FindToolbarThread.java
index 2b76da0..60eaf72 100644
--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/FindToolbarThread.java
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/FindToolbarThread.java
@@ -115,7 +115,7 @@ public void run() {
 				SWTCommit revision = fileRevisions[i];
 
 				if (findInCommitId) {
-					String contentId = revision.getId().toString();
+					String contentId = revision.getId().name();
 					if (contentId != null) {
 						if (ignoreCase) {
 							contentId = contentId.toLowerCase();
-- 
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