From a1492f192207bc20383de02f206a7bdf41064fbb Mon Sep 17 00:00:00 2001 From: Robin Rosenberg Date: Sat, 10 Jul 2010 02:32:46 +0200 Subject: [PATCH 1/2] Say that commit is allowed during bisect C Git allows this and it is quite handy. Change-Id: I1d0238b43fca931ad2079649fb7b431e2815c351 Signed-off-by: Robin Rosenberg --- .../src/org/eclipse/jgit/lib/RepositoryState.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RepositoryState.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RepositoryState.java index 901d1b516..0fa2db8e2 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RepositoryState.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RepositoryState.java @@ -144,8 +144,8 @@ public enum RepositoryState { /* Do not reset, checkout instead */ public boolean canResetHead() { return false; } - /* Actually it may make sense, but for now we err on the side of caution */ - public boolean canCommit() { return false; } + /* Commit during bisect is useful */ + public boolean canCommit() { return true; } public String getDescription() { return "Bisecting"; } }; From d787a82e509bfb908679777c3ad1d8a857470efb Mon Sep 17 00:00:00 2001 From: Robin Rosenberg Date: Sat, 10 Jul 2010 02:51:23 +0200 Subject: [PATCH 2/2] Internationalize RepositoryState descriptions Change-Id: I104cd62f3e89acf010b1d40a2b08e7f68f63bb85 Signed-off-by: Robin Rosenberg --- .../org/eclipse/jgit/JGitText.properties | 9 +++++++++ .../src/org/eclipse/jgit/JGitText.java | 9 +++++++++ .../org/eclipse/jgit/lib/RepositoryState.java | 19 ++++++++++--------- 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/org.eclipse.jgit/resources/org/eclipse/jgit/JGitText.properties b/org.eclipse.jgit/resources/org/eclipse/jgit/JGitText.properties index 91b67daf8..c37a1eabc 100644 --- a/org.eclipse.jgit/resources/org/eclipse/jgit/JGitText.properties +++ b/org.eclipse.jgit/resources/org/eclipse/jgit/JGitText.properties @@ -299,6 +299,15 @@ remoteHungUpUnexpectedly=remote hung up unexpectedly remoteNameCantBeNull=Remote name can't be null. repositoryAlreadyExists=Repository already exists: {0} repositoryNotFound=repository not found: {0} +repositoryState_applyMailbox=Apply mailbox +repositoryState_bisecting=Bisecting +repositoryState_conflicts=Conflicts +repositoryState_merged=Merged +repositoryState_normal=Normal +repositoryState_rebase=Rebase +repositoryState_rebaseInteractive=Rebase interactive +repositoryState_rebaseOrApplyMailbox=Rebase/Apply mailbox +repositoryState_rebaseWithMerge=Rebase w/merge requiredHashFunctionNotAvailable=Required hash function {0} not available. resolvingDeltas=Resolving deltas serviceNotPermitted={0} not permitted diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/JGitText.java b/org.eclipse.jgit/src/org/eclipse/jgit/JGitText.java index 0c64b9edd..a3813fd2e 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/JGitText.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/JGitText.java @@ -358,6 +358,15 @@ public class JGitText extends TranslationBundle { /***/ public String remoteNameCantBeNull; /***/ public String repositoryAlreadyExists; /***/ public String repositoryNotFound; + /***/ public String repositoryState_applyMailbox; + /***/ public String repositoryState_bisecting; + /***/ public String repositoryState_conflicts; + /***/ public String repositoryState_merged; + /***/ public String repositoryState_normal; + /***/ public String repositoryState_rebase; + /***/ public String repositoryState_rebaseInteractive; + /***/ public String repositoryState_rebaseOrApplyMailbox; + /***/ public String repositoryState_rebaseWithMerge; /***/ public String requiredHashFunctionNotAvailable; /***/ public String resolvingDeltas; /***/ public String serviceNotPermitted; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RepositoryState.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RepositoryState.java index 0fa2db8e2..2cf522579 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RepositoryState.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RepositoryState.java @@ -46,6 +46,7 @@ package org.eclipse.jgit.lib; +import org.eclipse.jgit.JGitText; /** * Important state of the repository that affects what can and cannot bed * done. This is things like unhandled conflicted merges and unfinished rebase. @@ -61,7 +62,7 @@ public enum RepositoryState { public boolean canCheckout() { return true; } public boolean canResetHead() { return true; } public boolean canCommit() { return true; } - public String getDescription() { return "Normal"; } + public String getDescription() { return JGitText.get().repositoryState_normal; } }, /** An unfinished merge. Must resole or reset before continuing normally @@ -70,7 +71,7 @@ public enum RepositoryState { public boolean canCheckout() { return false; } public boolean canResetHead() { return false; } public boolean canCommit() { return false; } - public String getDescription() { return "Conflicts"; } + public String getDescription() { return JGitText.get().repositoryState_conflicts; } }, /** @@ -81,7 +82,7 @@ public enum RepositoryState { public boolean canCheckout() { return true; } public boolean canResetHead() { return true; } public boolean canCommit() { return true; } - public String getDescription() { return "Merged"; } + public String getDescription() { return JGitText.get().repositoryState_merged; } }, /** @@ -91,7 +92,7 @@ public enum RepositoryState { public boolean canCheckout() { return false; } public boolean canResetHead() { return false; } public boolean canCommit() { return true; } - public String getDescription() { return "Rebase/Apply mailbox"; } + public String getDescription() { return JGitText.get().repositoryState_rebaseOrApplyMailbox; } }, /** @@ -101,7 +102,7 @@ public enum RepositoryState { public boolean canCheckout() { return false; } public boolean canResetHead() { return false; } public boolean canCommit() { return true; } - public String getDescription() { return "Rebase"; } + public String getDescription() { return JGitText.get().repositoryState_rebase; } }, /** @@ -111,7 +112,7 @@ public enum RepositoryState { public boolean canCheckout() { return false; } public boolean canResetHead() { return false; } public boolean canCommit() { return true; } - public String getDescription() { return "Apply mailbox"; } + public String getDescription() { return JGitText.get().repositoryState_applyMailbox; } }, /** @@ -121,7 +122,7 @@ public enum RepositoryState { public boolean canCheckout() { return false; } public boolean canResetHead() { return false; } public boolean canCommit() { return true; } - public String getDescription() { return "Rebase w/merge"; } + public String getDescription() { return JGitText.get().repositoryState_rebaseWithMerge; } }, /** @@ -131,7 +132,7 @@ public enum RepositoryState { public boolean canCheckout() { return false; } public boolean canResetHead() { return false; } public boolean canCommit() { return true; } - public String getDescription() { return "Rebase interactive"; } + public String getDescription() { return JGitText.get().repositoryState_rebaseInteractive; } }, /** @@ -147,7 +148,7 @@ public enum RepositoryState { /* Commit during bisect is useful */ public boolean canCommit() { return true; } - public String getDescription() { return "Bisecting"; } + public String getDescription() { return JGitText.get().repositoryState_bisecting; } }; /**