summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorJens Baumgart2010-03-11 03:55:39 (EST)
committer Stefan Lay2010-03-19 05:05:28 (EDT)
commitee944e60a9994cd6f6eb58c0f4be07480a306261 (patch)
tree861d5546af794877646fcb35cc6258e3d90e0888
parent192e69bd888cf9511803cbcb487f6c307fa0edb2 (diff)
downloadegit-ee944e60a9994cd6f6eb58c0f4be07480a306261.zip
egit-ee944e60a9994cd6f6eb58c0f4be07480a306261.tar.gz
egit-ee944e60a9994cd6f6eb58c0f4be07480a306261.tar.bz2
Externalize strings / add NON-NLS comments for technical stringsrefs/changes/32/332/3
All translatable strings in the EGit Core plugin were externalized. Technical strings were marked with the NON-NLS comment. Change-Id: Ibb87e7ba1aac29f80569deb58a59090415581d44 Signed-off-by: Jens Baumgart <jens.baumgart@sap.com>
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/Activator.java6
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/ContainerTreeIterator.java7
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/CoreText.java108
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/EclipseGitProgressTransformer.java20
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/GitCorePreferences.java12
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/GitMoveDeleteHook.java3
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/coretext.properties36
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/internal/UpdateJob.java16
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/BlobStorage.java9
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/CommitFileRevision.java14
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/GitFileHistory.java25
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/GitFileRevision.java4
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/IndexFileRevision.java7
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/WorkspaceFileRevision.java4
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/op/AssumeUnchangedOperation.java5
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/op/BranchOperation.java22
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/op/CloneOperation.java16
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/op/DisconnectProviderOperation.java4
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/op/ListRemoteOperation.java3
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/op/PushOperationResult.java6
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/op/ResetOperation.java37
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/op/TrackOperation.java6
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/op/UntrackOperation.java3
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/project/GitProjectData.java48
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/project/RepositoryFinder.java9
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/project/RepositoryMapping.java18
26 files changed, 328 insertions, 120 deletions
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/Activator.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/Activator.java
index 422eff5..bbc3c50 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/Activator.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/Activator.java
@@ -64,7 +64,7 @@ public class Activator extends Plugin {
private static boolean isOptionSet(final String optionId) {
final String option = getPluginId() + optionId;
final String value = Platform.getDebugOption(option);
- return value != null && value.equals("true");
+ return value != null && value.equals("true"); //$NON-NLS-1$
}
/**
@@ -74,7 +74,7 @@ public class Activator extends Plugin {
*/
public static void trace(final String what) {
if (getDefault().traceVerbose) {
- System.out.println("[" + getPluginId() + "] " + what);
+ System.out.println("[" + getPluginId() + "] " + what); //$NON-NLS-1$ //$NON-NLS-2$
}
}
@@ -89,7 +89,7 @@ public class Activator extends Plugin {
public void start(final BundleContext context) throws Exception {
super.start(context);
- traceVerbose = isOptionSet("/trace/verbose");
+ traceVerbose = isOptionSet("/trace/verbose"); //$NON-NLS-1$
GitProjectData.reconfigureWindowCache();
GitProjectData.attachToWorkspace(true);
}
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/ContainerTreeIterator.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/ContainerTreeIterator.java
index d498317..2a2ed38 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/ContainerTreeIterator.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/ContainerTreeIterator.java
@@ -48,7 +48,8 @@ public class ContainerTreeIterator extends WorkingTreeIterator {
private static String computePrefix(final IContainer base) {
final RepositoryMapping rm = RepositoryMapping.getMapping(base);
if (rm == null)
- throw new IllegalArgumentException("Not in a Git project: " + base);
+ throw new IllegalArgumentException(
+ "Not in a Git project: " + base); //$NON-NLS-1$
return rm.getRepoRelativePath(base);
}
@@ -84,7 +85,7 @@ public class ContainerTreeIterator extends WorkingTreeIterator {
* the workspace root to walk over.
*/
public ContainerTreeIterator(final IWorkspaceRoot root) {
- super("");
+ super(""); //$NON-NLS-1$
node = root;
init(entries());
}
@@ -220,7 +221,7 @@ public class ContainerTreeIterator extends WorkingTreeIterator {
throw ioe;
}
}
- throw new IOException("Not a regular file: " + rsrc);
+ throw new IOException("Not a regular file: " + rsrc); //$NON-NLS-1$
}
/**
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/CoreText.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/CoreText.java
index 47b11b8..16978ec 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/CoreText.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/CoreText.java
@@ -20,12 +20,27 @@ public class CoreText extends NLS {
public static String AssumeUnchangedOperation_adding;
/** */
+ public static String AssumeUnchangedOperation_writingIndex;
+
+ /** */
+ public static String UpdateJob_updatingIndex;
+
+ /** */
+ public static String UpdateJob_writingIndex;
+
+ /** */
public static String UpdateOperation_updating;
/** */
public static String UpdateOperation_failed;
/** */
+ public static String CommitFileRevision_errorLookingUpPath;
+
+ /** */
+ public static String CommitFileRevision_pathNotIn;
+
+ /** */
public static String ConnectProviderOperation_connecting;
/** */
@@ -41,12 +56,54 @@ public class CoreText extends NLS {
public static String AddOperation_failed;
/** */
+ public static String BlobStorage_blobNotFound;
+
+ /** */
+ public static String BlobStorage_errorReadingBlob;
+
+ /** */
+ public static String BranchOperation_checkoutMovingTo;
+
+ /** */
+ public static String BranchOperation_checkoutProblem;
+
+ /** */
+ public static String BranchOperation_mappingCommit;
+
+ /** */
+ public static String BranchOperation_mappingCommitHead;
+
+ /** */
+ public static String BranchOperation_mappingTrees;
+
+ /** */
+ public static String BranchOperation_updatingHeadToRef;
+
+ /** */
+ public static String BranchOperation_writingIndex;
+
+ /** */
public static String UntrackOperation_adding;
/** */
public static String UntrackOperation_failed;
/** */
+ public static String UntrackOperation_writingIndex;
+
+ /** */
+ public static String GitFileHistory_errorParsingHistory;
+
+ /** */
+ public static String GitFileHistory_gitNotAttached;
+
+ /** */
+ public static String GitFileHistory_invalidHeadRevision;
+
+ /** */
+ public static String GitFileHistory_noHeadRevisionAvailable;
+
+ /** */
public static String GitProjectData_lazyResolveFailed;
/** */
@@ -56,6 +113,12 @@ public class CoreText extends NLS {
public static String GitProjectData_cannotReadHEAD;
/** */
+ public static String GitProjectData_failedFindingRepoMapping;
+
+ /** */
+ public static String GitProjectData_failedToCacheRepoMapping;
+
+ /** */
public static String GitProjectData_missing;
/** */
@@ -68,6 +131,30 @@ public class CoreText extends NLS {
public static String RepositoryFinder_finding;
/** */
+ public static String ResetOperation_cantUpdate;
+
+ /** */
+ public static String ResetOperation_lookingUpCommit;
+
+ /** */
+ public static String ResetOperation_lookingUpRef;
+
+ /** */
+ public static String ResetOperation_mappingTreeForCommit;
+
+ /** */
+ public static String ResetOperation_performingReset;
+
+ /** */
+ public static String ResetOperation_readingIndex;
+
+ /** */
+ public static String ResetOperation_updatingFailed;
+
+ /** */
+ public static String ResetOperation_writingIndex;
+
+ /** */
public static String MoveDeleteHook_cannotModifyFolder;
/** */
@@ -77,9 +164,24 @@ public class CoreText extends NLS {
public static String Error_CanonicalFile;
/** */
+ public static String CloneOperation_checkingOutFiles;
+
+ /** */
+ public static String CloneOperation_initializingRepository;
+
+ /** */
public static String CloneOperation_title;
/** */
+ public static String CloneOperation_writingIndex;
+
+ /** */
+ public static String IndexFileRevision_errorLookingUpPath;
+
+ /** */
+ public static String IndexFileRevision_indexEntryNotFound;
+
+ /** */
public static String ListRemoteOperation_title;
/** */
@@ -103,7 +205,11 @@ public class CoreText extends NLS {
/** */
public static String AddToIndexOperation_failed;
+ /** */
+ public static String TrackOperation_writingIndex;
+
static {
- initializeMessages("org.eclipse.egit.core.coretext", CoreText.class);
+ initializeMessages("org.eclipse.egit.core.coretext", //$NON-NLS-1$
+ CoreText.class);
}
}
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/EclipseGitProgressTransformer.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/EclipseGitProgressTransformer.java
index 051b946..50fb6e3 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/EclipseGitProgressTransformer.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/EclipseGitProgressTransformer.java
@@ -14,6 +14,8 @@ import org.eclipse.jgit.lib.ProgressMonitor;
/** Create a new Git to Eclipse progress monitor. */
public class EclipseGitProgressTransformer implements ProgressMonitor {
+ private final String EMPTY_STRING = ""; //$NON-NLS-1$
+
private final IProgressMonitor root;
private IProgressMonitor task;
@@ -35,7 +37,7 @@ public class EclipseGitProgressTransformer implements ProgressMonitor {
}
public void start(final int totalTasks) {
- root.beginTask("", totalTasks * 1000);
+ root.beginTask(EMPTY_STRING, totalTasks * 1000);
}
public void beginTask(final String name, final int total) {
@@ -45,9 +47,9 @@ public class EclipseGitProgressTransformer implements ProgressMonitor {
totalWork = total;
task = new SubProgressMonitor(root, 1000);
if (totalWork == UNKNOWN)
- task.beginTask("", IProgressMonitor.UNKNOWN);
+ task.beginTask(EMPTY_STRING, IProgressMonitor.UNKNOWN);
else
- task.beginTask("", totalWork);
+ task.beginTask(EMPTY_STRING, totalWork);
task.subTask(msg);
}
@@ -57,13 +59,13 @@ public class EclipseGitProgressTransformer implements ProgressMonitor {
final int cmp = lastWorked + work;
if (lastWorked == UNKNOWN && cmp > 0) {
- task.subTask(msg + ", " + cmp);
+ task.subTask(msg + ", " + cmp); //$NON-NLS-1$
} else if (totalWork <= 0) {
// Do nothing to update the task.
} else if (cmp * 100 / totalWork != lastWorked * 100 / totalWork) {
final StringBuilder m = new StringBuilder();
m.append(msg);
- m.append(": ");
+ m.append(": "); //$NON-NLS-1$
while (m.length() < 25)
m.append(' ');
@@ -73,18 +75,18 @@ public class EclipseGitProgressTransformer implements ProgressMonitor {
final String twstr = String.valueOf(totalWork);
String cmpstr = String.valueOf(cmp);
while (cmpstr.length() < twstr.length())
- cmpstr = " " + cmpstr;
+ cmpstr = " " + cmpstr; //$NON-NLS-1$
final int pcnt = (cmp * 100 / totalWork);
if (pcnt < 100)
m.append(' ');
if (pcnt < 10)
m.append(' ');
m.append(pcnt);
- m.append("% (");
+ m.append("% ("); //$NON-NLS-1$
m.append(cmpstr);
- m.append("/");
+ m.append("/"); //$NON-NLS-1$
m.append(twstr);
- m.append(")");
+ m.append(")"); //$NON-NLS-1$
}
task.subTask(m.toString());
}
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/GitCorePreferences.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/GitCorePreferences.java
index 2023886..ba1ecef 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/GitCorePreferences.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/GitCorePreferences.java
@@ -11,11 +11,15 @@ package org.eclipse.egit.core;
/** Preferences used by the core plugin. */
public class GitCorePreferences {
/** */
- public static final String core_packedGitWindowSize = "core_packedGitWindowSize";
+ public static final String core_packedGitWindowSize =
+ "core_packedGitWindowSize"; //$NON-NLS-1$
/** */
- public static final String core_packedGitLimit = "core_packedGitLimit";
+ public static final String core_packedGitLimit =
+ "core_packedGitLimit"; //$NON-NLS-1$
/** */
- public static final String core_packedGitMMAP = "core_packedGitMMAP";
+ public static final String core_packedGitMMAP =
+ "core_packedGitMMAP"; //$NON-NLS-1$
/** */
- public static final String core_deltaBaseCacheLimit = "core_deltaBaseCacheLimit";
+ public static final String core_deltaBaseCacheLimit =
+ "core_deltaBaseCacheLimit"; //$NON-NLS-1$
}
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/GitMoveDeleteHook.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/GitMoveDeleteHook.java
index 7fd82c9..a5b8767 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/GitMoveDeleteHook.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/GitMoveDeleteHook.java
@@ -165,7 +165,8 @@ class GitMoveDeleteHook implements IMoveDeleteHook {
final DirCacheEditor sEdit = sCache.editor();
sEdit.add(new DirCacheEditor.DeleteTree(sPath));
if (dstm != null && dstm.getRepository() == srcm.getRepository()) {
- final String dPath = srcm.getRepoRelativePath(dstf) + "/";
+ final String dPath =
+ srcm.getRepoRelativePath(dstf) + "/"; //$NON-NLS-1$
final int sPathLen = sPath.length() + 1;
for (final DirCacheEntry se : sEnt) {
final String p = se.getPathString().substring(sPathLen);
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/coretext.properties b/org.eclipse.egit.core/src/org/eclipse/egit/core/coretext.properties
index 7c3981b..398cee7 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/coretext.properties
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/coretext.properties
@@ -7,11 +7,15 @@
#
###############################################################################
+CommitFileRevision_pathNotIn=Path not in {0}.
+CommitFileRevision_errorLookingUpPath=IO error looking up path in {0}.
ConnectProviderOperation_connecting=Connecting Git team provider.
ConnectProviderOperation_ConnectingProject=Connecting project {0}
DisconnectProviderOperation_disconnecting=Disconnecting Git team provider.
+UpdateJob_updatingIndex=Update index
+UpdateJob_writingIndex=Writing index for {0}
UpdateOperation_updating=Updating index
UpdateOperation_failed=Failed to update index
@@ -19,17 +23,42 @@ AddOperation_adding=Adding resources.
AddOperation_failed=Failed to add resource.
AssumeUnchangedOperation_adding=Marking resources unchanged
+AssumeUnchangedOperation_writingIndex=Writing index for {0}
+BlobStorage_blobNotFound=Git blob {0} not found.
+BlobStorage_errorReadingBlob=IO error reading Git blob {0}.
+BranchOperation_checkoutMovingTo=checkout: moving to {0}
+BranchOperation_checkoutProblem=Problem while checking out:
+BranchOperation_mappingCommit=Mapping commit: {0}
+BranchOperation_mappingCommitHead=Mapping commit HEAD commit
+BranchOperation_mappingTrees=Mapping trees
+BranchOperation_updatingHeadToRef=Updating HEAD to ref: {0}
+BranchOperation_writingIndex=Writing index
UntrackOperation_adding=Untracking (removing) resources.
UntrackOperation_failed=Failed to untrack resource.
+UntrackOperation_writingIndex=Writing index for {0}
+GitFileHistory_errorParsingHistory=Error parsing history for {0}.
+GitFileHistory_gitNotAttached=Git not attached to project {0}.
+GitFileHistory_invalidHeadRevision=Invalid HEAD revision for project {0}.
+GitFileHistory_noHeadRevisionAvailable=No HEAD revision available from Git for project {0}.
GitProjectData_mappedResourceGone=A mapped resource no longer exists in Eclipse.
GitProjectData_cannotReadHEAD=Current tree for `HEAD` cannot be obtained.
+GitProjectData_failedFindingRepoMapping=Failed finding RepositoryMapping
+GitProjectData_failedToCacheRepoMapping=Failed to cache RepositoryMapping
GitProjectData_missing=Git team provider configuration has gone missing.
GitProjectData_saveFailed=Saving Git team provider data to {0} failed.
GitProjectData_notifyChangedFailed=Resource change notification failed.
GitProjectData_lazyResolveFailed=Unable to load a referenced tree.
RepositoryFinder_finding=Searching for associated repositories.
+ResetOperation_cantUpdate=Can't update {0}
+ResetOperation_lookingUpCommit=looking up commit {0}
+ResetOperation_lookingUpRef=looking up ref {0}
+ResetOperation_mappingTreeForCommit=mapping tree for commit
+ResetOperation_performingReset=Performing {0} reset to {1}
+ResetOperation_readingIndex=Reading index
+ResetOperation_updatingFailed=Updating {0} failed
+ResetOperation_writingIndex=Writing index
MoveDeleteHook_cannotModifyFolder=Folder contains an active Git repository.\n\
The folder cannot be moved, renamed or deleted until the team provider is disconnected.
@@ -39,7 +68,12 @@ The resource cannot be moved, renamed or deleted due to an internal error.
Error_CanonicalFile=Unable to determine a canonical file path.
+CloneOperation_checkingOutFiles=Checking out files
+CloneOperation_initializingRepository=Initializing local repository
CloneOperation_title=Cloning from {0}
+CloneOperation_writingIndex=Writing index
+IndexFileRevision_errorLookingUpPath=IO error looking up path in index.
+IndexFileRevision_indexEntryNotFound=Git index entry not found
ListRemoteOperation_title=Getting remote branches information
@@ -51,3 +85,5 @@ PushOperation_taskNameDryRun=Trying pushing to remote repositories
PushOperation_taskNameNormalRun=Pushing to remote repositories
AddToIndexOperation_failed=Failed to add resource to index
+
+TrackOperation_writingIndex=Writing index for {0} \ No newline at end of file
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/UpdateJob.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/UpdateJob.java
index de07e11..85561b0 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/UpdateJob.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/UpdateJob.java
@@ -34,6 +34,7 @@ import org.eclipse.egit.core.project.RepositoryMapping;
import org.eclipse.jgit.errors.NotSupportedException;
import org.eclipse.jgit.lib.GitIndex;
import org.eclipse.jgit.lib.GitIndex.Entry;
+import org.eclipse.osgi.util.NLS;
/**
* This job updates the index with the content of all specified
@@ -50,7 +51,7 @@ public class UpdateJob extends Job {
* @param rsrcList
*/
public UpdateJob(Collection rsrcList) {
- super("Update index");
+ super(CoreText.UpdateJob_updatingIndex);
this.rsrcList = rsrcList;
setPriority(Job.LONG);
}
@@ -60,7 +61,7 @@ public class UpdateJob extends Job {
m = new NullProgressMonitor();
}
- trace("running");
+ trace("running"); //$NON-NLS-1$
try {
final IdentityHashMap<RepositoryMapping, Boolean> tomerge = new IdentityHashMap<RepositoryMapping, Boolean>();
try {
@@ -82,7 +83,9 @@ public class UpdateJob extends Job {
}
}
long t1=System.currentTimeMillis();
- System.out.println("Counted "+count[0]+" items to update in "+(t1-t0)/1000.0+"s");
+ System.out.println("Counted " + count[0] //$NON-NLS-1$
+ + " items to update in " //$NON-NLS-1$
+ + (t1 - t0) / 1000.0 + "s"); //$NON-NLS-1$
m.beginTask(CoreText.UpdateOperation_updating, count[0]);
final IProgressMonitor fm = m;
for (Object obj : rsrcList) {
@@ -121,7 +124,8 @@ public class UpdateJob extends Job {
}
}
for (RepositoryMapping rm : tomerge.keySet()) {
- m.setTaskName("Writing index for "+rm.getRepository().getDirectory());
+ m.setTaskName(NLS.bind(CoreText.UpdateJob_writingIndex, rm
+ .getRepository().getDirectory()));
rm.getRepository().getIndex().write();
}
} catch (NotSupportedException e) {
@@ -150,7 +154,7 @@ public class UpdateJob extends Job {
}
}
} finally {
- trace("done");
+ trace("done"); //$NON-NLS-1$
m.done();
}
@@ -158,7 +162,7 @@ public class UpdateJob extends Job {
}
private void trace(final String m) {
- Activator.trace("(UpdateJob)"+m);
+ Activator.trace("(UpdateJob)"+m); //$NON-NLS-1$
}
}
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/BlobStorage.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/BlobStorage.java
index 05aa0ed..f637453 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/BlobStorage.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/BlobStorage.java
@@ -19,11 +19,13 @@ import org.eclipse.core.resources.IStorage;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
+import org.eclipse.egit.core.CoreText;
import org.eclipse.jgit.errors.IncorrectObjectTypeException;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.ObjectLoader;
import org.eclipse.jgit.lib.Repository;
+import org.eclipse.osgi.util.NLS;
/** Accesses a blob from Git. */
class BlobStorage implements IStorage {
@@ -45,8 +47,8 @@ class BlobStorage implements IStorage {
return open();
} catch (IOException e) {
throw new ResourceException(IResourceStatus.FAILED_READ_LOCAL,
- getFullPath(), "IO error reading Git blob " + blobId + ".",
- e);
+ getFullPath(), NLS.bind(
+ CoreText.BlobStorage_errorReadingBlob, blobId), e);
}
}
@@ -55,7 +57,8 @@ class BlobStorage implements IStorage {
final ObjectLoader reader = db.openBlob(blobId);
if (reader == null)
throw new ResourceException(IResourceStatus.FAILED_READ_LOCAL,
- getFullPath(), "Git blob " + blobId + " not found.", null);
+ getFullPath(), NLS.bind(CoreText.BlobStorage_blobNotFound,
+ blobId), null);
final byte[] data = reader.getBytes();
if (reader.getType() != Constants.OBJ_BLOB)
throw new IncorrectObjectTypeException(blobId, Constants.TYPE_BLOB);
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/CommitFileRevision.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/CommitFileRevision.java
index ddd0ceb..7f55f8e 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/CommitFileRevision.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/CommitFileRevision.java
@@ -20,7 +20,9 @@ import org.eclipse.core.resources.IStorage;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Path;
+import org.eclipse.egit.core.CoreText;
import org.eclipse.egit.core.GitTag;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.team.core.history.IFileRevision;
import org.eclipse.team.core.history.ITag;
import org.eclipse.jgit.lib.AnyObjectId;
@@ -89,7 +91,7 @@ class CommitFileRevision extends GitFileRevision {
}
public String toString() {
- return commit.getId() + ":" + path;
+ return commit.getId() + ":" + path; //$NON-NLS-1$
}
public ITag[] getTags() {
@@ -119,13 +121,15 @@ class CommitFileRevision extends GitFileRevision {
final TreeWalk w = TreeWalk.forPath(db, path, commit.getTree());
if (w == null)
throw new ResourceException(IResourceStatus.FAILED_READ_LOCAL,
- Path.fromPortableString(path), "Path not in "
- + commit.getId() + ".", null);
+ Path.fromPortableString(path), NLS.bind(
+ CoreText.CommitFileRevision_pathNotIn, commit
+ .getId()), null);
return w.getObjectId(0);
} catch (IOException e) {
throw new ResourceException(IResourceStatus.FAILED_READ_LOCAL, Path
- .fromPortableString(path), "IO error looking up path in "
- + commit.getId() + ".", e);
+ .fromPortableString(path), NLS.bind(
+ CoreText.CommitFileRevision_errorLookingUpPath, commit
+ .getId()), e);
}
}
}
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/GitFileHistory.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/GitFileHistory.java
index 377b6ab..7b6a406 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/GitFileHistory.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/GitFileHistory.java
@@ -16,7 +16,9 @@ import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.egit.core.Activator;
+import org.eclipse.egit.core.CoreText;
import org.eclipse.egit.core.project.RepositoryMapping;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.team.core.history.IFileHistoryProvider;
import org.eclipse.team.core.history.IFileRevision;
import org.eclipse.team.core.history.provider.FileHistory;
@@ -58,8 +60,8 @@ class GitFileHistory extends FileHistory implements IAdaptable {
private KidWalk buildWalk() {
final RepositoryMapping rm = RepositoryMapping.getMapping(resource);
if (rm == null) {
- Activator.logError("Git not attached to project "
- + resource.getProject().getName() + ".", null);
+ Activator.logError(NLS.bind(CoreText.GitFileHistory_gitNotAttached,
+ resource.getProject().getName()), null);
return null;
}
@@ -81,9 +83,9 @@ class GitFileHistory extends FileHistory implements IAdaptable {
try {
final AnyObjectId headId = db.resolve(Constants.HEAD);
if (headId == null) {
- Activator.logError("No HEAD revision available from Git"
- + " for project " + resource.getProject().getName()
- + ".", null);
+ Activator.logError(NLS.bind(
+ CoreText.GitFileHistory_noHeadRevisionAvailable,
+ resource.getProject().getName()), null);
return NO_REVISIONS;
}
@@ -101,8 +103,9 @@ class GitFileHistory extends FileHistory implements IAdaptable {
walk.markStart(root);
} catch (IOException e) {
- Activator.logError("Invalid HEAD revision for project "
- + resource.getProject().getName() + ".", e);
+ Activator.logError(NLS.bind(
+ CoreText.GitFileHistory_invalidHeadRevision, resource
+ .getProject().getName()), e);
return NO_REVISIONS;
}
@@ -118,8 +121,9 @@ class GitFileHistory extends FileHistory implements IAdaptable {
break;
}
} catch (IOException e) {
- Activator.logError("Error parsing history for "
- + resource.getFullPath() + ".", e);
+ Activator.logError(NLS.bind(
+ CoreText.GitFileHistory_errorParsingHistory, resource
+ .getFullPath()), e);
return NO_REVISIONS;
}
@@ -162,7 +166,8 @@ class GitFileHistory extends FileHistory implements IAdaptable {
}
public IFileRevision getFileRevision(final String id) {
- if (id == null || id.equals("") || GitFileRevision.WORKSPACE.equals(id))
+ if (id == null || id.equals("") //$NON-NLS-1$
+ || GitFileRevision.WORKSPACE.equals(id))
return new WorkspaceFileRevision(resource);
if (GitFileRevision.INDEX.equals(id))
return new IndexFileRevision(walk.getRepository(), gitPath);
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/GitFileRevision.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/GitFileRevision.java
index 77d53a9..01b82f5 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/GitFileRevision.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/GitFileRevision.java
@@ -26,10 +26,10 @@ import org.eclipse.jgit.revwalk.RevCommit;
*/
public abstract class GitFileRevision extends FileRevision {
/** Content identifier for the working copy. */
- public static final String WORKSPACE = "Workspace";
+ public static final String WORKSPACE = "Workspace"; //$NON-NLS-1$
/** Content identifier for the content staged in the index. */
- public static final String INDEX = "Index";
+ public static final String INDEX = "Index"; //$NON-NLS-1$
/**
* Obtain a file revision for a specific blob of an existing commit.
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/IndexFileRevision.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/IndexFileRevision.java
index 8cf81c9..756c4d0 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/IndexFileRevision.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/IndexFileRevision.java
@@ -18,6 +18,7 @@ import org.eclipse.core.resources.IStorage;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Path;
+import org.eclipse.egit.core.CoreText;
import org.eclipse.team.core.history.IFileRevision;
import org.eclipse.jgit.lib.GitIndex;
import org.eclipse.jgit.lib.ObjectId;
@@ -54,7 +55,7 @@ class IndexFileRevision extends GitFileRevision implements IFileRevision {
}
public String getAuthor() {
- return "";
+ return ""; //$NON-NLS-1$
}
public long getTimestamp() {
@@ -76,13 +77,13 @@ class IndexFileRevision extends GitFileRevision implements IFileRevision {
if (e == null)
throw new ResourceException(IResourceStatus.FAILED_READ_LOCAL,
Path.fromPortableString(path),
- "Git index entry not found", null);
+ CoreText.IndexFileRevision_indexEntryNotFound, null);
return e.getObjectId();
} catch (IOException e) {
throw new ResourceException(IResourceStatus.FAILED_READ_LOCAL, Path
.fromPortableString(path),
- "IO error looking up path in index.", e);
+ CoreText.IndexFileRevision_errorLookingUpPath, e);
}
}
}
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/WorkspaceFileRevision.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/WorkspaceFileRevision.java
index e3f4500..b65629f 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/WorkspaceFileRevision.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/WorkspaceFileRevision.java
@@ -39,7 +39,7 @@ class WorkspaceFileRevision extends GitFileRevision implements IFileRevision {
}
public String getAuthor() {
- return "";
+ return ""; //$NON-NLS-1$
}
public long getTimestamp() {
@@ -47,7 +47,7 @@ class WorkspaceFileRevision extends GitFileRevision implements IFileRevision {
}
public String getComment() {
- return "";
+ return ""; //$NON-NLS-1$
}
public String getContentIdentifier() {
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/AssumeUnchangedOperation.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/AssumeUnchangedOperation.java
index 21d6d9d..d8ce1c8 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/AssumeUnchangedOperation.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/AssumeUnchangedOperation.java
@@ -30,6 +30,7 @@ import org.eclipse.egit.core.project.RepositoryMapping;
import org.eclipse.jgit.dircache.DirCache;
import org.eclipse.jgit.dircache.DirCacheEntry;
import org.eclipse.jgit.lib.Repository;
+import org.eclipse.osgi.util.NLS;
/**
* Tell JGit to ignore changes in selected files
@@ -74,7 +75,9 @@ public class AssumeUnchangedOperation implements IWorkspaceRunnable {
for (Map.Entry<Repository, DirCache> e : caches.entrySet()) {
final Repository db = e.getKey();
final DirCache editor = e.getValue();
- m.setTaskName("Writing index for " + db.getDirectory());
+ m.setTaskName(NLS.bind(
+ CoreText.AssumeUnchangedOperation_writingIndex, db
+ .getDirectory()));
editor.write();
editor.commit();
}
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/BranchOperation.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/BranchOperation.java
index 9f17403..e7b3313 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/BranchOperation.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/BranchOperation.java
@@ -19,6 +19,8 @@ import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.egit.core.CoreText;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.team.core.TeamException;
import org.eclipse.jgit.errors.CheckoutConflictException;
import org.eclipse.jgit.lib.Commit;
@@ -91,7 +93,7 @@ public class BranchOperation implements IWorkspaceRunnable {
final File file = p.getLocation().toFile();
if (file.getAbsolutePath().startsWith(parentFile.getAbsolutePath())) {
try {
- System.out.println("Refreshing " + p);
+ System.out.println("Refreshing " + p); //$NON-NLS-1$
p.refreshLocal(IResource.DEPTH_INFINITE, null);
} catch (CoreException e) {
e.printStackTrace();
@@ -103,7 +105,8 @@ public class BranchOperation implements IWorkspaceRunnable {
private void updateHeadRef() throws TeamException {
try {
RefUpdate u = repository.updateRef(Constants.HEAD);
- u.setRefLogMessage("checkout: moving to " + refName, false);
+ u.setRefLogMessage(NLS.bind(
+ CoreText.BranchOperation_checkoutMovingTo, refName), false);
switch (u.link(refName)) {
case NEW:
case FORCED:
@@ -113,7 +116,8 @@ public class BranchOperation implements IWorkspaceRunnable {
throw new IOException(u.getResult().name());
}
} catch (IOException e) {
- throw new TeamException("Updating HEAD to ref: " + refName, e);
+ throw new TeamException(NLS.bind(
+ CoreText.BranchOperation_updatingHeadToRef, refName), e);
}
}
@@ -121,7 +125,7 @@ public class BranchOperation implements IWorkspaceRunnable {
try {
index.write();
} catch (IOException e) {
- throw new TeamException("Writing index", e);
+ throw new TeamException(CoreText.BranchOperation_writingIndex, e);
}
}
@@ -133,7 +137,7 @@ public class BranchOperation implements IWorkspaceRunnable {
TeamException teamException = new TeamException(e.getMessage());
throw teamException;
} catch (IOException e) {
- throw new TeamException("Problem while checking out:", e);
+ throw new TeamException(CoreText.BranchOperation_checkoutProblem, e);
}
}
@@ -143,7 +147,7 @@ public class BranchOperation implements IWorkspaceRunnable {
index = repository.getIndex();
newTree = newCommit.getTree();
} catch (IOException e) {
- throw new TeamException("Mapping trees", e);
+ throw new TeamException(CoreText.BranchOperation_mappingTrees, e);
}
}
@@ -151,13 +155,15 @@ public class BranchOperation implements IWorkspaceRunnable {
try {
newCommit = repository.mapCommit(refName);
} catch (IOException e) {
- throw new TeamException("Mapping commit: " + refName, e);
+ throw new TeamException(NLS.bind(
+ CoreText.BranchOperation_mappingCommit, refName), e);
}
try {
oldCommit = repository.mapCommit(Constants.HEAD);
} catch (IOException e) {
- throw new TeamException("Mapping commit HEAD commit", e);
+ throw new TeamException(CoreText.BranchOperation_mappingCommitHead,
+ e);
}
}
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/CloneOperation.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/CloneOperation.java
index f2af45b..a5be349 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/CloneOperation.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/CloneOperation.java
@@ -150,7 +150,7 @@ public class CloneOperation {
private void doInit(final IProgressMonitor monitor)
throws URISyntaxException, IOException {
- monitor.setTaskName("Initializing local repository");
+ monitor.setTaskName(CoreText.CloneOperation_initializingRepository);
local = new Repository(gitdir);
local.create();
@@ -165,7 +165,8 @@ public class CloneOperation {
final String dst = Constants.R_REMOTES + remoteConfig.getName();
RefSpec wcrs = new RefSpec();
wcrs = wcrs.setForceUpdate(true);
- wcrs = wcrs.setSourceDestination(Constants.R_HEADS + "*", dst + "/*");
+ wcrs = wcrs.setSourceDestination(Constants.R_HEADS
+ + "*", dst + "/*"); //$NON-NLS-1$ //$NON-NLS-2$
if (allSelected) {
remoteConfig.addFetchRefSpec(wcrs);
@@ -176,7 +177,8 @@ public class CloneOperation {
}
// we're setting up for a clone with a checkout
- local.getConfig().setBoolean("core", null, "bare", false);
+ local.getConfig().setBoolean(
+ "core", null, "bare", false); //$NON-NLS-1$ //$NON-NLS-2$
remoteConfig.update(local.getConfig());
@@ -186,9 +188,9 @@ public class CloneOperation {
// setup the default remote branch for branchName
local.getConfig().setString(RepositoryConfig.BRANCH_SECTION,
- branchName, "remote", remoteName);
+ branchName, "remote", remoteName); //$NON-NLS-1$
local.getConfig().setString(RepositoryConfig.BRANCH_SECTION,
- branchName, "merge", branch);
+ branchName, "merge", branch); //$NON-NLS-1$
local.getConfig().save();
}
@@ -220,10 +222,10 @@ public class CloneOperation {
u.setNewObjectId(mapCommit.getCommitId());
u.forceUpdate();
- monitor.setTaskName("Checking out files");
+ monitor.setTaskName(CoreText.CloneOperation_checkingOutFiles);
co = new WorkDirCheckout(local, local.getWorkDir(), index, tree);
co.checkout();
- monitor.setTaskName("Writing index");
+ monitor.setTaskName(CoreText.CloneOperation_writingIndex);
index.write();
}
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/DisconnectProviderOperation.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/DisconnectProviderOperation.java
index d672d59..9a2dd3a 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/DisconnectProviderOperation.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/DisconnectProviderOperation.java
@@ -57,7 +57,7 @@ public class DisconnectProviderOperation implements IWorkspaceRunnable {
if (obj instanceof IProject) {
final IProject p = (IProject) obj;
- Activator.trace("disconnect " + p.getName());
+ Activator.trace("disconnect " + p.getName()); //$NON-NLS-1$
unmarkTeamPrivate(p);
RepositoryProvider.unmap(p);
m.worked(100);
@@ -82,7 +82,7 @@ public class DisconnectProviderOperation implements IWorkspaceRunnable {
unmarkTeamPrivate((IContainer) c[k]);
}
if (c[k].isTeamPrivateMember()) {
- Activator.trace("notTeamPrivate " + c[k]);
+ Activator.trace("notTeamPrivate " + c[k]); //$NON-NLS-1$
c[k].setTeamPrivateMember(false);
}
}
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/ListRemoteOperation.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/ListRemoteOperation.java
index 61cfd69..5e1feee 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/ListRemoteOperation.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/ListRemoteOperation.java
@@ -106,6 +106,7 @@ public class ListRemoteOperation {
private void checkState() {
if (remoteRefsMap == null)
throw new IllegalStateException(
- "Error occurred during remote repo listing, no refs available");
+ "Error occurred during remote repo " + //$NON-NLS-1$
+ "listing, no refs available"); //$NON-NLS-1$
}
}
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/PushOperationResult.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/PushOperationResult.java
index 520951d..7540daf 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/PushOperationResult.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/PushOperationResult.java
@@ -125,11 +125,11 @@ public class PushOperationResult {
if (first)
first = false;
else
- sb.append(", ");
+ sb.append(", "); //$NON-NLS-1$
sb.append(uri);
- sb.append(" (");
+ sb.append(" ("); //$NON-NLS-1$
sb.append(getErrorMessage(uri));
- sb.append(")");
+ sb.append(")"); //$NON-NLS-1$
}
return sb.toString();
}
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/ResetOperation.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/ResetOperation.java
index 9178b6c..a6bef45 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/ResetOperation.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/ResetOperation.java
@@ -19,6 +19,7 @@ import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.egit.core.CoreText;
import org.eclipse.jgit.lib.Commit;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.GitIndex;
@@ -28,6 +29,7 @@ import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.lib.Tag;
import org.eclipse.jgit.lib.Tree;
import org.eclipse.jgit.lib.WorkDirCheckout;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.team.core.TeamException;
/**
@@ -76,7 +78,8 @@ public class ResetOperation implements IWorkspaceRunnable {
}
public void run(IProgressMonitor monitor) throws CoreException {
- monitor.beginTask("Performing " + type.toString().toLowerCase() + " reset to " + refName, 7);
+ monitor.beginTask(NLS.bind(CoreText.ResetOperation_performingReset,
+ type.toString().toLowerCase(), refName), 7);
mapObjects();
monitor.worked(1);
@@ -120,7 +123,7 @@ public class ResetOperation implements IWorkspaceRunnable {
try {
index.write();
} catch (IOException e1) {
- throw new TeamException("Writing index", e1);
+ throw new TeamException(CoreText.ResetOperation_writingIndex, e1);
}
}
@@ -131,7 +134,7 @@ public class ResetOperation implements IWorkspaceRunnable {
final File file = p.getLocation().toFile();
if (file.getAbsolutePath().startsWith(parentFile.getAbsolutePath())) {
try {
- System.out.println("Refreshing " + p);
+ System.out.println("Refreshing " + p); //$NON-NLS-1$
p.refreshLocal(IResource.DEPTH_INFINITE, null);
} catch (CoreException e) {
e.printStackTrace();
@@ -145,7 +148,8 @@ public class ResetOperation implements IWorkspaceRunnable {
try {
commitId = repository.resolve(refName);
} catch (IOException e) {
- throw new TeamException("looking up ref " + refName, e);
+ throw new TeamException(NLS.bind(
+ CoreText.ResetOperation_lookingUpRef, refName), e);
}
try {
commit = repository.mapCommit(commitId);
@@ -154,7 +158,8 @@ public class ResetOperation implements IWorkspaceRunnable {
Tag t = repository.mapTag(refName, commitId);
commit = repository.mapCommit(t.getObjId());
} catch (IOException e2) {
- throw new TeamException("looking up commit " + commitId, e2);
+ throw new TeamException(NLS.bind(
+ CoreText.ResetOperation_lookingUpCommit, commitId), e2);
}
}
@@ -165,16 +170,19 @@ public class ResetOperation implements IWorkspaceRunnable {
final RefUpdate ru = repository.updateRef(Constants.HEAD);
ru.setNewObjectId(commit.getCommitId());
String name = refName;
- if (name.startsWith("refs/heads/"))
+ if (name.startsWith("refs/heads/")) //$NON-NLS-1$
name = name.substring(11);
- if (name.startsWith("refs/remotes/"))
+ if (name.startsWith("refs/remotes/")) //$NON-NLS-1$
name = name.substring(13);
- String message = "reset --" + type.toString().toLowerCase() + " " + name;
+ String message = "reset --" //$NON-NLS-1$
+ + type.toString().toLowerCase() + " " + name; //$NON-NLS-1$
ru.setRefLogMessage(message, false);
if (ru.forceUpdate() == RefUpdate.Result.LOCK_FAILURE)
- throw new TeamException("Can't update " + ru.getName());
+ throw new TeamException(NLS.bind(
+ CoreText.ResetOperation_cantUpdate, ru.getName()));
} catch (IOException e) {
- throw new TeamException("Updating " + Constants.HEAD + " failed", e);
+ throw new TeamException(NLS.bind(
+ CoreText.ResetOperation_updatingFailed, Constants.HEAD), e);
}
}
@@ -183,7 +191,7 @@ public class ResetOperation implements IWorkspaceRunnable {
newTree = commit.getTree();
index = repository.getIndex();
} catch (IOException e) {
- throw new TeamException("Reading index", e);
+ throw new TeamException(CoreText.ResetOperation_readingIndex, e);
}
}
@@ -193,7 +201,7 @@ public class ResetOperation implements IWorkspaceRunnable {
index = repository.getIndex();
index.readTree(newTree);
} catch (IOException e) {
- throw new TeamException("Reading index", e);
+ throw new TeamException(CoreText.ResetOperation_readingIndex, e);
}
}
@@ -201,7 +209,7 @@ public class ResetOperation implements IWorkspaceRunnable {
try {
index.write();
} catch (IOException e) {
- throw new TeamException("Writing index", e);
+ throw new TeamException(CoreText.ResetOperation_writingIndex, e);
}
}
@@ -213,7 +221,8 @@ public class ResetOperation implements IWorkspaceRunnable {
workDirCheckout.setFailOnConflict(false);
workDirCheckout.checkout();
} catch (IOException e) {
- throw new TeamException("mapping tree for commit", e);
+ throw new TeamException(
+ CoreText.ResetOperation_mappingTreeForCommit, e);
}
}
}
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/TrackOperation.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/TrackOperation.java
index f2acf1b..1d12422 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/TrackOperation.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/TrackOperation.java
@@ -28,6 +28,7 @@ import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.egit.core.Activator;
import org.eclipse.egit.core.CoreText;
import org.eclipse.egit.core.project.RepositoryMapping;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.team.core.Team;
import org.eclipse.jgit.lib.GitIndex;
import org.eclipse.jgit.lib.GitIndex.Entry;
@@ -79,7 +80,8 @@ public class TrackOperation implements IWorkspaceRunnable {
Entry entry = index.getEntry(repoPath);
if (entry != null) {
if (!entry.isAssumedValid()) {
- System.out.println("Already tracked - skipping");
+ System.out
+ .println("Already tracked - skipping"); //$NON-NLS-1$
continue;
}
}
@@ -122,7 +124,7 @@ public class TrackOperation implements IWorkspaceRunnable {
m.worked(200);
}
for (RepositoryMapping rm : tomerge.keySet()) {
- m.setTaskName("Writing index for "+rm.getRepository().getDirectory());
+ m.setTaskName(NLS.bind(CoreText.TrackOperation_writingIndex, rm.getRepository().getDirectory()));
rm.getRepository().getIndex().write();
}
} catch (RuntimeException e) {
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/UntrackOperation.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/UntrackOperation.java
index ff6863b..32a8c86 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/UntrackOperation.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/UntrackOperation.java
@@ -30,6 +30,7 @@ import org.eclipse.egit.core.project.RepositoryMapping;
import org.eclipse.jgit.dircache.DirCache;
import org.eclipse.jgit.dircache.DirCacheEditor;
import org.eclipse.jgit.lib.Repository;
+import org.eclipse.osgi.util.NLS;
/**
* Remove one or more existing files/folders from the Git repository.
@@ -82,7 +83,7 @@ public class UntrackOperation implements IWorkspaceRunnable {
for (Map.Entry<Repository, DirCacheEditor> e : edits.entrySet()) {
final Repository db = e.getKey();
final DirCacheEditor editor = e.getValue();
- m.setTaskName("Writing index for " + db.getDirectory());
+ m.setTaskName(NLS.bind(CoreText.UntrackOperation_writingIndex, db.getDirectory()));
editor.commit();
}
} catch (RuntimeException e) {
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/project/GitProjectData.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/project/GitProjectData.java
index 7b19dd9..821e879 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/project/GitProjectData.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/project/GitProjectData.java
@@ -77,7 +77,7 @@ public class GitProjectData {
}
private static QualifiedName MAPPING_KEY = new QualifiedName(
- GitProjectData.class.getName(), "RepositoryMapping");
+ GitProjectData.class.getName(), "RepositoryMapping"); //$NON-NLS-1$
/**
* Start listening for resource changes.
@@ -85,7 +85,7 @@ public class GitProjectData {
* @param includeChange true to listen to content changes
*/
public static void attachToWorkspace(final boolean includeChange) {
- trace("attachToWorkspace - addResourceChangeListener");
+ trace("attachToWorkspace - addResourceChangeListener"); //$NON-NLS-1$
ResourcesPlugin.getWorkspace().addResourceChangeListener(
rcl,
(includeChange ? IResourceChangeEvent.POST_CHANGE : 0)
@@ -97,7 +97,7 @@ public class GitProjectData {
* Stop listening to resource changes
*/
public static void detachFromWorkspace() {
- trace("detachFromWorkspace - removeResourceChangeListener");
+ trace("detachFromWorkspace - removeResourceChangeListener"); //$NON-NLS-1$
ResourcesPlugin.getWorkspace().removeResourceChangeListener(rcl);
}
@@ -178,7 +178,7 @@ public class GitProjectData {
* @param p Eclipse project
*/
public static void delete(final IProject p) {
- trace("delete(" + p.getName() + ")");
+ trace("delete(" + p.getName() + ")"); //$NON-NLS-1$ //$NON-NLS-2$
GitProjectData d = lookup(p);
if (d == null) {
try {
@@ -191,7 +191,7 @@ public class GitProjectData {
}
static void trace(final String m) {
- Activator.trace("(GitProjectData) " + m);
+ Activator.trace("(GitProjectData) " + m); //$NON-NLS-1$
}
private synchronized static void cache(final IProject p,
@@ -201,7 +201,8 @@ public class GitProjectData {
private synchronized static void uncache(final IProject p) {
if (projectDataCache.remove(p) != null) {
- trace("uncacheDataFor(" + p.getName() + ")");
+ trace("uncacheDataFor(" //$NON-NLS-1$
+ + p.getName() + ")"); //$NON-NLS-1$
}
}
@@ -294,7 +295,7 @@ public class GitProjectData {
final File dotGitDir = dotGit.getLocation().toFile()
.getCanonicalFile();
if (dotGitDir.equals(r.getDirectory())) {
- trace("teamPrivate " + dotGit);
+ trace("teamPrivate " + dotGit); //$NON-NLS-1$
dotGit.setTeamPrivateMember(true);
}
} catch (IOException err) {
@@ -328,7 +329,8 @@ public class GitProjectData {
return m;
}
} catch (CoreException err) {
- Activator.logError("Failed finding RepositoryMapping", err);
+ Activator.logError(
+ CoreText.GitProjectData_failedFindingRepoMapping, err);
}
return null;
}
@@ -344,7 +346,9 @@ public class GitProjectData {
}
}
dir.delete();
- trace("deleteDataFor(" + getProject().getName() + ")");
+ trace("deleteDataFor(" //$NON-NLS-1$
+ + getProject().getName()
+ + ")"); //$NON-NLS-1$
uncache(getProject());
}
@@ -359,8 +363,11 @@ public class GitProjectData {
boolean ok = false;
try {
- trace("save " + dat);
- tmp = File.createTempFile("gpd_", ".prop", dat.getParentFile());
+ trace("save " + dat); //$NON-NLS-1$
+ tmp = File.createTempFile(
+ "gpd_", //$NON-NLS-1$
+ ".prop", //$NON-NLS-1$
+ dat.getParentFile());
final FileOutputStream o = new FileOutputStream(tmp);
try {
final Properties p = new Properties();
@@ -368,7 +375,7 @@ public class GitProjectData {
while (i.hasNext()) {
((RepositoryMapping) i.next()).store(p);
}
- p.store(o, "GitProjectData");
+ p.store(o, "GitProjectData"); //$NON-NLS-1$
ok = true;
} finally {
o.close();
@@ -392,12 +399,12 @@ public class GitProjectData {
private File propertyFile() {
return new File(getProject()
.getWorkingLocation(Activator.getPluginId()).toFile(),
- "GitProjectData.properties");
+ "GitProjectData.properties"); //$NON-NLS-1$
}
private GitProjectData load() throws IOException {
final File dat = propertyFile();
- trace("load " + dat);
+ trace("load " + dat); //$NON-NLS-1$
final FileInputStream o = new FileInputStream(dat);
try {
@@ -451,7 +458,8 @@ public class GitProjectData {
m.setContainer(c);
git = c.getLocation().append(m.getGitDirPath()).toFile();
- if (!git.isDirectory() || !new File(git, "config").isFile()) {
+ if (!git.isDirectory()
+ || !new File(git, "config").isFile()) { //$NON-NLS-1$
Activator.logError(CoreText.GitProjectData_mappedResourceGone,
new FileNotFoundException(m.getContainerPath().toString()));
m.clear();
@@ -469,11 +477,15 @@ public class GitProjectData {
m.fireRepositoryChanged();
- trace("map " + c + " -> " + m.getRepository());
+ trace("map " //$NON-NLS-1$
+ + c
+ + " -> " //$NON-NLS-1$
+ + m.getRepository());
try {
c.setSessionProperty(MAPPING_KEY, m);
} catch (CoreException err) {
- Activator.logError("Failed to cache RepositoryMapping", err);
+ Activator.logError(
+ CoreText.GitProjectData_failedToCacheRepoMapping, err);
}
dotGit = c.findMember(Constants.DOT_GIT);
@@ -484,7 +496,7 @@ public class GitProjectData {
private void protect(IResource c) {
while (c != null && !c.equals(getProject())) {
- trace("protect " + c);
+ trace("protect " + c); //$NON-NLS-1$
protectedResources.add(c);
c = c.getParent();
}
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/project/RepositoryFinder.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/project/RepositoryFinder.java
index 0dae1b9..ffe4fc0 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/project/RepositoryFinder.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/project/RepositoryFinder.java
@@ -98,7 +98,7 @@ public class RepositoryFinder {
throws CoreException {
final IPath loc = c.getLocation();
- m.beginTask("", 101);
+ m.beginTask("", 101); //$NON-NLS-1$
m.subTask(CoreText.RepositoryFinder_finding);
try {
if (loc != null) {
@@ -113,7 +113,9 @@ public class RepositoryFinder {
if (c.isLinked() || c instanceof IProject) {
File p = fsLoc.getParentFile();
while (p != null) {
- System.out.println("Looking at candidate dir: " + p);
+ System.out.println(
+ "Looking at candidate dir: " //$NON-NLS-1$
+ + p);
final File pCfg = configFor(p);
if (pCfg.isFile()) {
register(c, pCfg.getParentFile());
@@ -146,7 +148,8 @@ public class RepositoryFinder {
}
private File configFor(final File fsLoc) {
- return new File(new File(fsLoc, Constants.DOT_GIT), "config");
+ return new File(new File(fsLoc, Constants.DOT_GIT),
+ "config"); //$NON-NLS-1$
}
private void register(final IContainer c, final File gitdir) {
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/project/RepositoryMapping.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/project/RepositoryMapping.java
index 68da558..8ea86d7 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/project/RepositoryMapping.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/project/RepositoryMapping.java
@@ -37,7 +37,7 @@ import org.eclipse.jgit.lib.GitIndex.Entry;
*/
public class RepositoryMapping {
static boolean isInitialKey(final String key) {
- return key.endsWith(".gitdir");
+ return key.endsWith(".gitdir"); //$NON-NLS-1$
}
private final String containerPath;
@@ -92,9 +92,9 @@ public class RepositoryMapping {
gitdirPath = remainder.toPortableString().substring(device.length());
} else if (gLocParent.isPrefixOf(cLoc)) {
cnt = cLoc.segmentCount() - cLoc.matchingFirstSegments(gLocParent);
- p = "";
+ p = ""; //$NON-NLS-1$
while (cnt-- > 0) {
- p += "../";
+ p += "../"; //$NON-NLS-1$
}
p += gLoc.segment(gLoc.segmentCount() - 1);
gitdirPath = p;
@@ -143,8 +143,8 @@ public class RepositoryMapping {
workdirPrefix = getWorkDir().getAbsolutePath();
}
workdirPrefix = workdirPrefix.replace('\\', '/');
- if (!workdirPrefix.endsWith("/"))
- workdirPrefix += "/";
+ if (!workdirPrefix.endsWith("/")) //$NON-NLS-1$
+ workdirPrefix += "/"; //$NON-NLS-1$
}
/**
@@ -168,11 +168,13 @@ public class RepositoryMapping {
}
synchronized void store(final Properties p) {
- p.setProperty(containerPath + ".gitdir", gitdirPath);
+ p.setProperty(containerPath + ".gitdir", gitdirPath); //$NON-NLS-1$
}
public String toString() {
- return "RepositoryMapping[" + containerPath + " -> " + gitdirPath + "]";
+ return "RepositoryMapping[" //$NON-NLS-1$
+ + containerPath + " -> " //$NON-NLS-1$
+ + gitdirPath + "]"; //$NON-NLS-1$
}
/**
@@ -221,7 +223,7 @@ public class RepositoryMapping {
if (pLen > pfxLen)
return p.substring(pfxLen);
else if (p.length() == pfxLen - 1)
- return "";
+ return ""; //$NON-NLS-1$
return null;
}