Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Hohenegger2018-09-01 06:52:29 -0400
committerMatthias Sohn2018-09-03 19:02:49 -0400
commitebbe1afadc34b435faccb8daf4a7ce3d2e96d534 (patch)
tree4aac27ce2a0d075bf070685e43a3051dd2830fca /org.eclipse.egit.gitflow
parent942688d80b40440e9835110982be2c4fbacecff7 (diff)
downloadegit-ebbe1afadc34b435faccb8daf4a7ce3d2e96d534.tar.gz
egit-ebbe1afadc34b435faccb8daf4a7ce3d2e96d534.tar.xz
egit-ebbe1afadc34b435faccb8daf4a7ce3d2e96d534.zip
Cleaned up Gitflow NLS
- prefer NLS.bind over String.format for consistency - fixed typos 'Feautre', 'Hotifx', 'inital' - fixed inconsistent use of single quotes for branch names - fixed inconsistent use of "Gitflow" - removed redundant NLS string 'Not on a feature branch' - removed unused NLS string 'Not on ...' - removed unused NLS field 'HotfixFinishOperation_mergeF...' Change-Id: Ibf652c22dee080f493cce0efc3256a6041663d09
Diffstat (limited to 'org.eclipse.egit.gitflow')
-rw-r--r--org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/internal/CoreText.java14
-rw-r--r--org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/internal/coretext.properties30
-rw-r--r--org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/AbstractFeatureOperation.java2
-rw-r--r--org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/AbstractVersionFinishOperation.java4
-rw-r--r--org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/FeatureRebaseOperation.java7
-rw-r--r--org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/FeatureTrackOperation.java5
-rw-r--r--org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/GitFlowOperation.java10
-rw-r--r--org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/ReleaseStartOperation.java11
8 files changed, 32 insertions, 51 deletions
diff --git a/org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/internal/CoreText.java b/org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/internal/CoreText.java
index 9f3a5a071..2b8928efe 100644
--- a/org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/internal/CoreText.java
+++ b/org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/internal/CoreText.java
@@ -31,7 +31,7 @@ public class CoreText extends NLS {
}
/** */
- public static String AbstractFeatureOperation_notOnAFeautreBranch;
+ public static String AbstractFeatureOperation_notOnAFeatureBranch;
/** */
public static String AbstractHotfixOperation_notOnAHotfixBranch;
@@ -52,9 +52,6 @@ public class CoreText extends NLS {
public static String unableToStoreGitConfig;
/** */
- public static String FeatureRebaseOperation_notOnAFeatureBranch;
-
- /** */
public static String FeatureStartOperation_andBranchMayBeFastForwarded;
/** */
@@ -64,9 +61,6 @@ public class CoreText extends NLS {
public static String FeatureStartOperation_divergingDevelop;
/** */
- public static String FeatureStartOperation_notOn;
-
- /** */
public static String FeatureTrackOperation_checkoutReturned;
/** */
@@ -94,9 +88,6 @@ public class CoreText extends NLS {
public static String HotfixFinishOperation_hotfix;
/** */
- public static String HotfixFinishOperation_mergeFromHotfixToMasterFailed;
-
- /** */
public static String InitOperation_initialCommit;
/** */
@@ -106,9 +97,6 @@ public class CoreText extends NLS {
public static String ReleaseFinishOperation_releaseOf;
/** */
- public static String ReleaseStartOperation_notOn;
-
- /** */
public static String ReleaseStartOperation_releaseNameAlreadyExists;
/** */
diff --git a/org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/internal/coretext.properties b/org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/internal/coretext.properties
index 502153508..00bfef483 100644
--- a/org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/internal/coretext.properties
+++ b/org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/internal/coretext.properties
@@ -8,31 +8,27 @@
#
# SPDX-License-Identifier: EPL-2.0
###############################################################################
-AbstractFeatureOperation_notOnAFeautreBranch=Not on a feature branch.
+AbstractFeatureOperation_notOnAFeatureBranch=Not on a feature branch.
AbstractHotfixOperation_notOnAHotfixBranch=Not on a hotfix branch.
AbstractReleaseOperation_notOnAReleaseBranch=Not on a release branch.
-AbstractVersionFinishOperation_tagNameExists=Tag with name '%s' already exists\!
+AbstractVersionFinishOperation_tagNameExists=Tag with name ''{0}'' already exists\!
FeatureListOperation_unableToParse=Unable to parse: {0}
pushToRemoteFailed=Push to remote repository failed: {0}
unableToStoreGitConfig=Unable to store git config.
-FeatureRebaseOperation_notOnAFeatureBranch=Not on a feature branch.
FeatureStartOperation_andBranchMayBeFastForwarded=And branch ''{0}'' may be fast-forwarded.
FeatureStartOperation_andLocalDevelopIsAheadOfOrigin=And local branch ''{0}'' is ahead of ''{1}''.
FeatureStartOperation_divergingDevelop=Branches ''{0}'' and ''{1}'' have diverged.
-FeatureStartOperation_notOn=Not on {0}
-FeatureTrackOperation_checkoutReturned=Trying checkout '%s' returned: %s
-FeatureTrackOperation_localBranchExists=Local branch '%s' already exists.
+FeatureTrackOperation_checkoutReturned=Trying checkout ''{0}'' returned: {1}
+FeatureTrackOperation_localBranchExists=Local branch ''{0}'' already exists.
FeatureTrackOperation_unableToStoreGitConfig=Unable to store git config.
-GitFlowOperation_branchMissing=Branch %s missing
-GitFlowOperation_branchNotFound=No branch '%s' found.
-GitFlowOperation_unableToCheckout=Unable to checkout '%s': %s
-GitFlowOperation_unableToMerge=Unable to merge '%s' into '%s'. MergeResult was null.
-GitFlowRepository_gitFlowRepositoryMayNotBeEmpty=Git flow repository may not be empty.
-HotfixFinishOperation_hotfix=Hotifx {0}
-HotfixFinishOperation_mergeFromHotfixToMasterFailed=Merge from Hotfix to Master branch failed. This shouldn't happen in GitFlow.
-InitOperation_initialCommit=Git Flow inital commit
+GitFlowOperation_branchMissing=Branch ''{0}'' missing
+GitFlowOperation_branchNotFound=No branch ''{0}'' found.
+GitFlowOperation_unableToCheckout=Unable to checkout ''{0}'': {1}
+GitFlowOperation_unableToMerge=Unable to merge ''{0}'' into ''{1}''. MergeResult was null.
+GitFlowRepository_gitFlowRepositoryMayNotBeEmpty=Gitflow repository may not be empty.
+HotfixFinishOperation_hotfix=Hotfix {0}
+InitOperation_initialCommit=Gitflow initial commit
InitOperation_localMasterDoesNotExist=Local branch ''{0}'' does not exist.
ReleaseFinishOperation_releaseOf=Release of {0}
-ReleaseStartOperation_notOn=Not on {0}
-ReleaseStartOperation_releaseNameAlreadyExists=The release name '%s' already exists.
-StartOperation_unableToFindCommitFor=Unable to find commit for {0}
+ReleaseStartOperation_releaseNameAlreadyExists=The release name ''{0}'' already exists.
+StartOperation_unableToFindCommitFor=Unable to find commit for ''{0}''
diff --git a/org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/AbstractFeatureOperation.java b/org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/AbstractFeatureOperation.java
index 24f1d198c..58758ca3b 100644
--- a/org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/AbstractFeatureOperation.java
+++ b/org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/AbstractFeatureOperation.java
@@ -46,7 +46,7 @@ abstract public class AbstractFeatureOperation extends GitFlowOperation {
String currentBranch = repository.getRepository().getBranch();
if (currentBranch == null || !repository.isFeature()) {
throw new WrongGitFlowStateException(
- CoreText.AbstractFeatureOperation_notOnAFeautreBranch);
+ CoreText.AbstractFeatureOperation_notOnAFeatureBranch);
}
return currentBranch.substring(repository.getConfig()
.getFeaturePrefix().length());
diff --git a/org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/AbstractVersionFinishOperation.java b/org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/AbstractVersionFinishOperation.java
index 407df7f85..065d45e9c 100644
--- a/org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/AbstractVersionFinishOperation.java
+++ b/org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/AbstractVersionFinishOperation.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.egit.gitflow.op;
-import static java.lang.String.format;
import static org.eclipse.egit.gitflow.Activator.error;
import java.io.IOException;
@@ -24,6 +23,7 @@ import org.eclipse.egit.gitflow.internal.CoreText;
import org.eclipse.jgit.lib.PersonIdent;
import org.eclipse.jgit.lib.TagBuilder;
import org.eclipse.jgit.revwalk.RevCommit;
+import org.eclipse.osgi.util.NLS;
/**
* common logic for git flow * finish
@@ -64,7 +64,7 @@ abstract public class AbstractVersionFinishOperation extends GitFlowOperation {
if (commitForTag == null) {
createTag(monitor, head, tagName, tagMessage);
} else if (!head.equals(commitForTag)) {
- throw new CoreException(error(format(
+ throw new CoreException(error(NLS.bind(
CoreText.AbstractVersionFinishOperation_tagNameExists,
versionName)));
}
diff --git a/org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/FeatureRebaseOperation.java b/org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/FeatureRebaseOperation.java
index a02140d29..022d47b0f 100644
--- a/org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/FeatureRebaseOperation.java
+++ b/org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/FeatureRebaseOperation.java
@@ -10,14 +10,13 @@
*******************************************************************************/
package org.eclipse.egit.gitflow.op;
+import static org.eclipse.egit.gitflow.Activator.error;
+
import java.io.IOException;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.egit.core.op.RebaseOperation;
-
-import static org.eclipse.egit.gitflow.Activator.error;
-
import org.eclipse.egit.gitflow.GitFlowRepository;
import org.eclipse.egit.gitflow.WrongGitFlowStateException;
import org.eclipse.egit.gitflow.internal.CoreText;
@@ -43,7 +42,7 @@ public final class FeatureRebaseOperation extends GitFlowOperation {
try {
if (!repository.isFeature()) {
throw new WrongGitFlowStateException(
- CoreText.FeatureRebaseOperation_notOnAFeatureBranch);
+ CoreText.AbstractFeatureOperation_notOnAFeatureBranch);
}
Repository jgitRepo = repository.getRepository();
diff --git a/org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/FeatureTrackOperation.java b/org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/FeatureTrackOperation.java
index cc13e73fc..72d2b0ba2 100644
--- a/org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/FeatureTrackOperation.java
+++ b/org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/FeatureTrackOperation.java
@@ -31,6 +31,7 @@ import org.eclipse.jgit.api.errors.GitAPIException;
import org.eclipse.jgit.lib.BranchConfig.BranchRebaseMode;
import org.eclipse.jgit.lib.Ref;
import org.eclipse.jgit.transport.FetchResult;
+import org.eclipse.osgi.util.NLS;
/**
* git flow feature track
@@ -84,7 +85,7 @@ public final class FeatureTrackOperation extends AbstractFeatureOperation {
operationResult = fetch(progress.newChild(1), timeout);
if (repository.hasBranch(newLocalBranch)) {
- String errorMessage = String.format(
+ String errorMessage = NLS.bind(
CoreText.FeatureTrackOperation_localBranchExists,
newLocalBranch);
throw new CoreException(error(errorMessage));
@@ -99,7 +100,7 @@ public final class FeatureTrackOperation extends AbstractFeatureOperation {
branchOperation.execute(progress.newChild(1));
CheckoutResult result = branchOperation.getResult();
if (!Status.OK.equals(result.getStatus())) {
- String errorMessage = String.format(
+ String errorMessage = NLS.bind(
CoreText.FeatureTrackOperation_checkoutReturned,
newLocalBranch, result.getStatus().name());
throw new CoreException(error(errorMessage));
diff --git a/org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/GitFlowOperation.java b/org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/GitFlowOperation.java
index 4d688b217..b3c3e7c1a 100644
--- a/org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/GitFlowOperation.java
+++ b/org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/GitFlowOperation.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.egit.gitflow.op;
-import static java.lang.String.format;
import static org.eclipse.egit.gitflow.Activator.error;
import static org.eclipse.jgit.api.MergeCommand.FastForwardMode.NO_FF;
@@ -43,6 +42,7 @@ import org.eclipse.jgit.revwalk.RevWalkUtils;
import org.eclipse.jgit.revwalk.filter.RevFilter;
import org.eclipse.jgit.transport.FetchResult;
import org.eclipse.jgit.transport.RemoteConfig;
+import org.eclipse.osgi.util.NLS;
/**
* Common logic for Git Flow operations.
@@ -132,7 +132,7 @@ abstract public class GitFlowOperation implements IEGitOperation {
Ref branch = repository.findBranch(branchName);
if (branch == null) {
- throw new IllegalStateException(String.format(
+ throw new IllegalStateException(NLS.bind(
CoreText.GitFlowOperation_branchMissing, branchName));
}
boolean forceDelete = squash;
@@ -173,7 +173,7 @@ abstract public class GitFlowOperation implements IEGitOperation {
String targetBranchName, boolean squash, boolean fastForwardSingleCommit) throws CoreException {
try {
if (!repository.hasBranch(targetBranchName)) {
- throw new RuntimeException(String.format(
+ throw new RuntimeException(NLS.bind(
CoreText.GitFlowOperation_branchNotFound,
targetBranchName));
}
@@ -185,7 +185,7 @@ abstract public class GitFlowOperation implements IEGitOperation {
branchOperation.execute(progress.newChild(1));
Status status = branchOperation.getResult().getStatus();
if (!CheckoutResult.Status.OK.equals(status)) {
- throw new CoreException(error(format(
+ throw new CoreException(error(NLS.bind(
CoreText.GitFlowOperation_unableToCheckout, branchName,
status.toString())));
}
@@ -202,7 +202,7 @@ abstract public class GitFlowOperation implements IEGitOperation {
MergeResult result = mergeOperation.getResult();
if (result == null) {
- throw new CoreException(error(format(
+ throw new CoreException(error(NLS.bind(
CoreText.GitFlowOperation_unableToMerge, branchName,
targetBranchName)));
}
diff --git a/org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/ReleaseStartOperation.java b/org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/ReleaseStartOperation.java
index a6fa90e2c..42c1954a2 100644
--- a/org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/ReleaseStartOperation.java
+++ b/org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/ReleaseStartOperation.java
@@ -10,17 +10,14 @@
*******************************************************************************/
package org.eclipse.egit.gitflow.op;
-import java.io.IOException;
+import static org.eclipse.egit.gitflow.Activator.error;
+import static org.eclipse.jgit.lib.Constants.R_TAGS;
-import static java.lang.String.format;
+import java.io.IOException;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
-
-import static org.eclipse.egit.gitflow.Activator.error;
-import static org.eclipse.jgit.lib.Constants.*;
-
import org.eclipse.egit.gitflow.GitFlowConfig;
import org.eclipse.egit.gitflow.GitFlowRepository;
import org.eclipse.egit.gitflow.WrongGitFlowStateException;
@@ -76,7 +73,7 @@ public final class ReleaseStartOperation extends AbstractReleaseOperation {
try {
if (releaseExists()) {
throw new CoreException(
- error(format(
+ error(NLS.bind(
CoreText.ReleaseStartOperation_releaseNameAlreadyExists,
versionName)));
}

Back to the top