diff --git a/README.md b/README.md
index 779b0d7..d2de481 100644
--- a/README.md
+++ b/README.md
@@ -1,65 +1,65 @@
-# Git Flow Integration for Intellij
-
-
-An intelliJ plugin providing a UI layer for git-flow, which in itself is a collection of Git extensions to provide high-level repository operations for Vincent [Driessen's branching model](http://nvie.com/git-model).
-
-![screenshot](http://opherv.github.io/gitflow4idea/images/gitflow.jpg)
-
-## Supporting my work (so that the plugin doesn't die)
-
-Do you use this free software at work? Great! Would you like it to stay free? Of course you do.
-
-I'm not a Java developer. In fact, I don't even like Java. Still I've been actively supporting this plugin for the past 5+ years on my own free time.
-
-If saved you or your company time and effort, please consider supporting me by buying me a cup of coffee.
-Better yet, get your boss to donate 10 cups. It's company money, they won't mind.
-
-[![ko-fi](https://www.ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/R6R0TFS7)
-
-## Getting started
-
-For the best introduction to get started with `git flow`, please read Jeff Kreeftmeijer's blog post:
-
-[http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/](http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/)
-
-Or have a look at this [cheat sheet](http://danielkummer.github.io/git-flow-cheatsheet/) by Daniel Kummer:
-
-## Who and why
-
-This plugin was created by [Opher Vishnia](http://www.opherv.com), after I couldn't find any similar implementation.
-I saw this [suggestion page](http://youtrack.jetbrains.com/issue/IDEA-65491) on the JetBrains site has more than 220 likes and 80 comments, and decided to take up the gauntlet :)
-
-Huge shoutout [to Kirill Likhodedov](https://github.com/klikh), who wrote much of the original git4idea plugin, without which this plugin could not exist
-
-## Installation
-
-The plugin is available via the IntelliJ plugin manager. Just search for "Git Flow Integration" to get the latest version!
-
-(The plugin requires that you have gitflow installed. I *highly* recommend using the [AVH edition](https://github.com/petervanderdoes/gitflow), rather than [Vanilla Git Flow](https://github.com/nvie/gitflow) since the original isn't being maintained anymore)
-
-**Mac/Linux users:**
-
-If you're running into issues like getting
-`Gitflow is not installed`
-or
-`git: 'flow' is not a git command. See 'git --help'.`
-
-Please be sure to check out [this thread](https://github.com/OpherV/gitflow4idea/issues/7)
-
-
-## Caveats
-
-While the plugin is operational and contains all basic functions (init/feature/release/hotfix), it may contains bugs. With your help I'll be able to find and zap them all.
-
-## Helping out
-
-This project is under active development.
-If you encounter any bug or an issue, I encourage you to add the them to the [Issues list](https://github.com/OpherV/gitflow4idea/issues) on Github.
-Feedback and suggestions are also very welcome.
-
-## License
-
-This plugin is under the [Apache 2.0 license](http://www.apache.org/licenses/LICENSE-2.0.html).
-Copyright 2013-2018, Opher Vishnia.
-
-
+# Git Flow Integration for Intellij
+
+
+An intelliJ plugin providing a UI layer for git-flow, which in itself is a collection of Git extensions to provide high-level repository operations for Vincent [Driessen's branching model](http://nvie.com/git-model).
+
+![screenshot](http://opherv.github.io/gitflow4idea/images/gitflow.jpg)
+
+## Supporting my work (so that the plugin doesn't die)
+
+Do you use this free software at work? Great! Would you like it to stay free? Of course you do.
+
+I'm not a Java developer. In fact, I don't even like Java. Still I've been actively supporting this plugin for the past 5+ years on my own free time.
+
+If saved you or your company time and effort, please consider supporting me by buying me a cup of coffee.
+Better yet, get your boss to donate 10 cups. It's company money, they won't mind.
+
+[![ko-fi](https://www.ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/R6R0TFS7)
+
+## Getting started
+
+For the best introduction to get started with `git flow`, please read Jeff Kreeftmeijer's blog post:
+
+[http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/](http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/)
+
+Or have a look at this [cheat sheet](http://danielkummer.github.io/git-flow-cheatsheet/) by Daniel Kummer:
+
+## Who and why
+
+This plugin was created by [Opher Vishnia](http://www.opherv.com), after I couldn't find any similar implementation.
+I saw this [suggestion page](http://youtrack.jetbrains.com/issue/IDEA-65491) on the JetBrains site has more than 220 likes and 80 comments, and decided to take up the gauntlet :)
+
+Huge shoutout [to Kirill Likhodedov](https://github.com/klikh), who wrote much of the original git4idea plugin, without which this plugin could not exist
+
+## Installation
+
+The plugin is available via the IntelliJ plugin manager. Just search for "Git Flow Integration" to get the latest version!
+
+(The plugin requires that you have gitflow installed. I *highly* recommend using the [AVH edition](https://github.com/petervanderdoes/gitflow), rather than [Vanilla Git Flow](https://github.com/nvie/gitflow) since the original isn't being maintained anymore)
+
+**Mac/Linux users:**
+
+If you're running into issues like getting
+`Gitflow is not installed`
+or
+`git: 'flow' is not a git command. See 'git --help'.`
+
+Please be sure to check out [this thread](https://github.com/OpherV/gitflow4idea/issues/7)
+
+
+## Caveats
+
+While the plugin is operational and contains all basic functions (init/feature/release/hotfix), it may contains bugs. With your help I'll be able to find and zap them all.
+
+## Helping out
+
+This project is under active development.
+If you encounter any bug or an issue, I encourage you to add the them to the [Issues list](https://github.com/OpherV/gitflow4idea/issues) on Github.
+Feedback and suggestions are also very welcome.
+
+## License
+
+This plugin is under the [Apache 2.0 license](http://www.apache.org/licenses/LICENSE-2.0.html).
+Copyright 2013-2019, Opher Vishnia.
+
+
diff --git a/build.gradle b/build.gradle
index 16d72e7..a0c0ca3 100644
--- a/build.gradle
+++ b/build.gradle
@@ -8,7 +8,7 @@ compileJava {
}
group 'gitflow4idea'
-version '0.6.9'
+version '0.7.0'
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
@@ -29,11 +29,20 @@ intellij {
patchPluginXml {
pluginId "Gitflow"
pluginDescription 'Git Flow Integration'
- version '0.6.9'
+ version '0.7.0'
sinceBuild '182.0'
untilBuild '192.*'
changeNotes """
+
Changelog for 0.7.0
+
+ - Fix NPE when clicking Gitflow menu #245 (@opherv)
+ - Fix "Init gitflow" doesn't update widget #247 (@opherv)
+ - Fix Wrong message when finishing a feature #144 (@opherv)
+ - Feature: Re-init gitflow (access from VCS>Git>Gitflow>Advanced menu) #50 (@bmwsedee/@opherv)
+ - "Feature": Don't show branch select combo on new Hotfix (@opherv)
+
+
Changelog for 0.6.9
- Support for Idea build 192 #241 (@opherv)
diff --git a/src/main/java/gitflow/Gitflow.java b/src/main/java/gitflow/Gitflow.java
index 643185b..f388a33 100644
--- a/src/main/java/gitflow/Gitflow.java
+++ b/src/main/java/gitflow/Gitflow.java
@@ -13,8 +13,13 @@
*/
public interface Gitflow extends Git {
- public GitCommandResult initRepo(@NotNull GitRepository repository,
- GitflowInitOptions initOptions, @Nullable GitLineHandlerListener... listeners);
+ GitCommandResult initRepo(@NotNull GitRepository repository,
+ GitflowInitOptions initOptions,
+ @Nullable GitLineHandlerListener... listeners);
+
+ GitCommandResult reInitRepo(@NotNull GitRepository repository,
+ GitflowInitOptions initOptions,
+ @Nullable GitLineHandlerListener... listeners);
// feature
diff --git a/src/main/java/gitflow/GitflowBranchUtil.java b/src/main/java/gitflow/GitflowBranchUtil.java
index a096775..198806f 100644
--- a/src/main/java/gitflow/GitflowBranchUtil.java
+++ b/src/main/java/gitflow/GitflowBranchUtil.java
@@ -41,33 +41,38 @@ public GitflowBranchUtil(Project project, GitRepository repo){
myRepo = repo;
if (repo != null) {
- currentBranchName = GitBranchUtil.getBranchNameOrRev(repo);
-
- GitflowConfigUtil gitflowConfigUtil = GitflowConfigUtil.getInstance(project, repo);
- branchnameMaster = gitflowConfigUtil.masterBranch;
- branchnameDevelop = gitflowConfigUtil.developBranch;
- prefixFeature = gitflowConfigUtil.featurePrefix;
- prefixRelease = gitflowConfigUtil.releasePrefix;
- prefixHotfix = gitflowConfigUtil.hotfixPrefix;
- prefixBugfix = gitflowConfigUtil.bugfixPrefix;
-
- initRemoteBranches();
- initLocalBranchNames();
+ update();
}
}
+ public void update(){
+ currentBranchName = GitBranchUtil.getBranchNameOrRev(myRepo);
+
+ GitflowConfigUtil gitflowConfigUtil = GitflowConfigUtil.getInstance(myProject, myRepo);
+ gitflowConfigUtil.update();
+ branchnameMaster = gitflowConfigUtil.masterBranch;
+ branchnameDevelop = gitflowConfigUtil.developBranch;
+ prefixFeature = gitflowConfigUtil.featurePrefix;
+ prefixRelease = gitflowConfigUtil.releasePrefix;
+ prefixHotfix = gitflowConfigUtil.hotfixPrefix;
+ prefixBugfix = gitflowConfigUtil.bugfixPrefix;
+
+ initRemoteBranches();
+ initLocalBranchNames();
+ }
+
public String getCurrentBranchName() {
return currentBranchName;
}
public boolean hasGitflow(){
boolean hasGitflow = myRepo != null
- && branchnameMaster != null
- && branchnameDevelop != null
- && prefixFeature != null
- && prefixRelease != null
- && prefixHotfix != null
- && prefixBugfix != null;
+ && getBranchnameMaster() != null
+ && getBranchnameDevelop() != null
+ && getPrefixFeature() != null
+ && getPrefixRelease() != null
+ && getPrefixHotfix() != null
+ && getPrefixBugfix() != null;
return hasGitflow;
}
diff --git a/src/main/java/gitflow/GitflowBranchUtilManager.java b/src/main/java/gitflow/GitflowBranchUtilManager.java
index 6275111..6fc2dba 100644
--- a/src/main/java/gitflow/GitflowBranchUtilManager.java
+++ b/src/main/java/gitflow/GitflowBranchUtilManager.java
@@ -26,7 +26,11 @@ public class GitflowBranchUtilManager {
private static HashMap repoBranchUtilMap;
static public GitflowBranchUtil getBranchUtil(GitRepository repo){
- return repoBranchUtilMap.get(repo);
+ if (repoBranchUtilMap != null) {
+ return repoBranchUtilMap.get(repo);
+ } else {
+ return null;
+ }
}
static public void setupBranchUtil(Project project, GitRepository repo){
@@ -38,24 +42,17 @@ static public void setupBranchUtil(Project project, GitRepository repo){
* Repopulates the branchUtils for each repo
* @param project
*/
- static public Future update(Project proj){
- final Project project = proj;
- return (Future) ApplicationManager.getApplication().executeOnPooledThread(new Runnable() {
- @Override
- public void run() {
- if (repoBranchUtilMap == null){
- repoBranchUtilMap = new HashMap();
- }
-
- List gitRepositories = GitUtil.getRepositoryManager(project).getRepositories();
-
- Iterator gitRepositoriesIterator = gitRepositories.iterator();
- while(gitRepositoriesIterator.hasNext()){
- GitRepository repo = (GitRepository) gitRepositoriesIterator.next();
- GitflowBranchUtilManager.setupBranchUtil(project, repo);
- }
- }
- });
-
+ static public void update(Project proj){
+ if (repoBranchUtilMap == null){
+ repoBranchUtilMap = new HashMap();
+ }
+
+ List gitRepositories = GitUtil.getRepositoryManager(proj).getRepositories();
+
+ Iterator gitRepositoriesIterator = gitRepositories.iterator();
+ while(gitRepositoriesIterator.hasNext()){
+ GitRepository repo = (GitRepository) gitRepositoriesIterator.next();
+ GitflowBranchUtilManager.setupBranchUtil(proj, repo);
+ }
}
}
diff --git a/src/main/java/gitflow/GitflowConfigUtil.java b/src/main/java/gitflow/GitflowConfigUtil.java
index 9879adb..96cd1bd 100644
--- a/src/main/java/gitflow/GitflowConfigUtil.java
+++ b/src/main/java/gitflow/GitflowConfigUtil.java
@@ -1,5 +1,8 @@
package gitflow;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.Future;
+import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vcs.VcsException;
import com.intellij.openapi.vfs.VirtualFile;
@@ -60,20 +63,35 @@ public static GitflowConfigUtil getInstance(Project project_, GitRepository repo
project = project_;
repo = repo_;
+ update();
+ }
+
+ public void update(){
VirtualFile root = repo.getRoot();
try{
- masterBranch = GitConfigUtil.getValue(project, root, BRANCH_MASTER);
- developBranch = GitConfigUtil.getValue(project, root, BRANCH_DEVELOP);
- featurePrefix = GitConfigUtil.getValue(project,root,PREFIX_FEATURE);
- releasePrefix = GitConfigUtil.getValue(project,root,PREFIX_RELEASE);
- hotfixPrefix = GitConfigUtil.getValue(project,root,PREFIX_HOTFIX);
- bugfixPrefix = GitConfigUtil.getValue(project,root,PREFIX_BUGFIX);
- supportPrefix = GitConfigUtil.getValue(project,root,PREFIX_SUPPORT);
- versiontagPrefix = GitConfigUtil.getValue(project,root,PREFIX_VERSIONTAG);
-
- } catch (VcsException e) {
- NotifyUtil.notifyError(project, "Config error", e);
+ Future f = (Future) ApplicationManager.getApplication().executeOnPooledThread(new Runnable() {
+ @Override
+ public void run() {
+ try{
+ masterBranch = GitConfigUtil.getValue(project, root, BRANCH_MASTER);
+ developBranch = GitConfigUtil.getValue(project, root, BRANCH_DEVELOP);
+ featurePrefix = GitConfigUtil.getValue(project,root,PREFIX_FEATURE);
+ releasePrefix = GitConfigUtil.getValue(project,root,PREFIX_RELEASE);
+ hotfixPrefix = GitConfigUtil.getValue(project,root,PREFIX_HOTFIX);
+ bugfixPrefix = GitConfigUtil.getValue(project,root,PREFIX_BUGFIX);
+ supportPrefix = GitConfigUtil.getValue(project,root,PREFIX_SUPPORT);
+ versiontagPrefix = GitConfigUtil.getValue(project,root,PREFIX_VERSIONTAG);
+ } catch (VcsException e) {
+ NotifyUtil.notifyError(project, "Config error", e);
+ }
+ }});
+ f.get();
+
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ } catch (ExecutionException e) {
+ e.printStackTrace();
}
}
diff --git a/src/main/java/gitflow/GitflowImpl.java b/src/main/java/gitflow/GitflowImpl.java
index 05bf209..43da152 100644
--- a/src/main/java/gitflow/GitflowImpl.java
+++ b/src/main/java/gitflow/GitflowImpl.java
@@ -52,38 +52,45 @@ private void addOptionsCommand(GitLineHandler h, Project project, String optionI
public GitCommandResult initRepo(@NotNull GitRepository repository,
GitflowInitOptions initOptions, @Nullable GitLineHandlerListener... listeners) {
+ return callInit(repository, initOptions, false, listeners);
+ }
- GitCommandResult result;
+ public GitCommandResult reInitRepo(@NotNull GitRepository repository,
+ GitflowInitOptions initOptions,
+ @Nullable GitLineHandlerListener... listeners) {
+ return callInit(repository, initOptions, true, listeners);
+ }
+ private GitCommandResult callInit(@NotNull GitRepository repository,
+ GitflowInitOptions initOptions, boolean reInit,
+ @Nullable GitLineHandlerListener[] listeners) {
+ GitLineHandler h;
if (initOptions.isUseDefaults()) {
- final GitLineHandler h = new GitLineHandler(repository.getProject(), repository.getRoot(), GitflowCommand());
- h.setSilent(false);
- h.setStdoutSuppressed(false);
- h.setStderrSuppressed(false);
-
- h.addParameters("init");
- h.addParameters("-d");
-
- result = runCommand(h);
+ h = new GitLineHandler(repository.getProject(), repository.getRoot(), GitflowCommand());
} else {
+ h = new GitInitLineHandler(initOptions, repository.getProject(),
+ repository.getRoot(), GitflowCommand());
+ }
+ h.setSilent(false);
+ h.setStdoutSuppressed(false);
+ h.setStderrSuppressed(false);
- final GitInitLineHandler h = new GitInitLineHandler(initOptions, repository.getProject(), repository.getRoot(), GitflowCommand());
-
- h.setSilent(false);
- h.setStdoutSuppressed(false);
- h.setStderrSuppressed(false);
-
- h.addParameters("init");
+ h.addParameters("init");
+ if (initOptions.isUseDefaults()) {
+ h.addParameters("-d");
+ } else {
for (GitLineHandlerListener listener : listeners) {
h.addLineListener(listener);
}
- result = runCommand(h);
}
+ if (reInit) {
+ h.addParameters("-f");
+ }
- return result;
+ return runCommand(h);
}
diff --git a/src/main/java/gitflow/GitflowMenu.java b/src/main/java/gitflow/GitflowMenu.java
new file mode 100644
index 0000000..42c742a
--- /dev/null
+++ b/src/main/java/gitflow/GitflowMenu.java
@@ -0,0 +1,32 @@
+package gitflow;
+
+import com.intellij.openapi.actionSystem.ActionGroup;
+import com.intellij.openapi.actionSystem.AnAction;
+import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.project.Project;
+import gitflow.actions.GitflowPopupGroup;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+public class GitflowMenu extends ActionGroup {
+ public GitflowMenu() {
+ super("Gitflow", true);
+ }
+
+ @NotNull
+ @Override
+ public AnAction[] getChildren(@Nullable AnActionEvent anActionEvent) {
+ if (anActionEvent == null) {
+ return new AnAction[0];
+ }
+
+ Project project = anActionEvent.getProject();
+ if (project == null) {
+ return new AnAction[0];
+ }
+
+ GitflowPopupGroup popupGroup = new GitflowPopupGroup(project, true);
+
+ return popupGroup.getActionGroup().getChildren(anActionEvent);
+ }
+}
diff --git a/src/main/java/gitflow/actions/AbstractTrackAction.java b/src/main/java/gitflow/actions/AbstractTrackAction.java
index 7e3f06d..40fa6ab 100644
--- a/src/main/java/gitflow/actions/AbstractTrackAction.java
+++ b/src/main/java/gitflow/actions/AbstractTrackAction.java
@@ -16,13 +16,13 @@ protected boolean isActionAllowedForBranch() {
String prefix;
switch (type) {
case Feature:
- prefix = featurePrefix;
+ prefix = branchUtil.getPrefixFeature();;
break;
case Release:
- prefix = releasePrefix;
+ prefix = branchUtil.getPrefixRelease();
break;
case Bugfix:
- prefix = bugfixPrefix;
+ prefix = branchUtil.getPrefixBugfix();
break;
default:
return false;
diff --git a/src/main/java/gitflow/actions/FinishBugfixAction.java b/src/main/java/gitflow/actions/FinishBugfixAction.java
index 7a0d97f..6cc7a5f 100644
--- a/src/main/java/gitflow/actions/FinishBugfixAction.java
+++ b/src/main/java/gitflow/actions/FinishBugfixAction.java
@@ -60,7 +60,7 @@ public void runAction(final Project project, final String bugfixName){
GitflowConfigUtil gitflowConfigUtil = GitflowConfigUtil.getInstance(project, myRepo);
//get the base branch for this bugfix
- final String baseBranch = gitflowConfigUtil.getBaseBranch(bugfixPrefix+bugfixName);
+ final String baseBranch = gitflowConfigUtil.getBaseBranch(branchUtil.getPrefixBugfix()+bugfixName);
new Task.Backgroundable(myProject,"Finishing bugfix "+bugfixName,false){
@Override
@@ -68,7 +68,7 @@ public void run(@NotNull ProgressIndicator indicator) {
GitCommandResult result = myGitflow.finishBugfix(myRepo, bugfixName, errorLineHandler);
if (result.success()) {
- String finishedBugfixMessage = String.format("The bugfix branch '%s%s' was merged into '%s'", bugfixPrefix, bugfixName, baseBranch);
+ String finishedBugfixMessage = String.format("The bugfix branch '%s%s' was merged into '%s'", branchUtil.getPrefixBugfix(), bugfixName, baseBranch);
NotifyUtil.notifySuccess(myProject, bugfixName, finishedBugfixMessage);
}
else if(errorLineHandler.hasMergeError){
diff --git a/src/main/java/gitflow/actions/FinishFeatureAction.java b/src/main/java/gitflow/actions/FinishFeatureAction.java
index c40836d..5c96b58 100644
--- a/src/main/java/gitflow/actions/FinishFeatureAction.java
+++ b/src/main/java/gitflow/actions/FinishFeatureAction.java
@@ -63,12 +63,12 @@ public void runAction(final Project project, final String featureName){
new Task.Backgroundable(myProject,"Finishing feature "+featureName,false){
@Override
public void run(@NotNull ProgressIndicator indicator) {
- GitCommandResult result = myGitflow.finishFeature(myRepo,featureName,errorLineHandler);
+ final String baseBranch = gitflowConfigUtil.getBaseBranch(branchUtil.getPrefixFeature()+featureName);
- final String baseBranch = gitflowConfigUtil.getBaseBranch(featurePrefix+featureName);
+ GitCommandResult result = myGitflow.finishFeature(myRepo,featureName,errorLineHandler);
if (result.success()) {
- String finishedFeatureMessage = String.format("The feature branch '%s%s' was merged into '%s'", featurePrefix, featureName, baseBranch);
+ String finishedFeatureMessage = String.format("The feature branch '%s%s' was merged into '%s'", branchUtil.getPrefixFeature(), featureName, baseBranch);
NotifyUtil.notifySuccess(myProject, featureName, finishedFeatureMessage);
}
else if(errorLineHandler.hasMergeError){
diff --git a/src/main/java/gitflow/actions/FinishHotfixAction.java b/src/main/java/gitflow/actions/FinishHotfixAction.java
index bed3d5b..ae3d986 100644
--- a/src/main/java/gitflow/actions/FinishHotfixAction.java
+++ b/src/main/java/gitflow/actions/FinishHotfixAction.java
@@ -63,7 +63,7 @@ public void run(@NotNull ProgressIndicator indicator) {
GitCommandResult result= myGitflow.finishHotfix(myRepo, hotfixName, tagMessage, errorLineHandler);
if (result.success()) {
- String finishedHotfixMessage = String.format("The hotfix branch '%s%s' was merged into '%s' and '%s'", hotfixPrefix, hotfixName, developBranch, masterBranch);
+ String finishedHotfixMessage = String.format("The hotfix branch '%s%s' was merged into '%s' and '%s'", branchUtil.getPrefixHotfix(), hotfixName, branchUtil.getBranchnameDevelop(), branchUtil.getBranchnameMaster());
NotifyUtil.notifySuccess(myProject, hotfixName, finishedHotfixMessage);
}
else {
diff --git a/src/main/java/gitflow/actions/FinishReleaseAction.java b/src/main/java/gitflow/actions/FinishReleaseAction.java
index f023828..1e383bb 100644
--- a/src/main/java/gitflow/actions/FinishReleaseAction.java
+++ b/src/main/java/gitflow/actions/FinishReleaseAction.java
@@ -82,7 +82,7 @@ public void run(@NotNull ProgressIndicator indicator) {
GitCommandResult result = myGitflow.finishRelease(myRepo, releaseName, tagMessage, errorLineHandler);
if (result.success()) {
- String finishedReleaseMessage = String.format("The release branch '%s%s' was merged into '%s' and '%s'", releasePrefix, releaseName, developBranch, masterBranch);
+ String finishedReleaseMessage = String.format("The release branch '%s%s' was merged into '%s' and '%s'", branchUtil.getPrefixRelease(), releaseName, branchUtil.getBranchnameDevelop(), branchUtil.getBranchnameMaster());
NotifyUtil.notifySuccess(myProject, releaseName, finishedReleaseMessage);
}
else if(errorLineHandler.hasMergeError){
diff --git a/src/main/java/gitflow/actions/GitflowAction.java b/src/main/java/gitflow/actions/GitflowAction.java
index 26c2572..f0d014a 100644
--- a/src/main/java/gitflow/actions/GitflowAction.java
+++ b/src/main/java/gitflow/actions/GitflowAction.java
@@ -27,16 +27,6 @@ public class GitflowAction extends DumbAwareAction {
VirtualFileManager virtualFileMananger;
-
- String currentBranchName;
-
- String featurePrefix;
- String releasePrefix;
- String hotfixPrefix;
- String bugfixPrefix;
- String masterBranch;
- String developBranch;
-
GitflowAction( String actionName){ super(actionName); }
GitflowAction(GitRepository repo, String actionName){
@@ -63,19 +53,6 @@ private void setup(Project project){
repos.add(myRepo);
branchUtil= GitflowBranchUtilManager.getBranchUtil(myRepo);
-
- setupPrefixes();
- }
-
- private void setupPrefixes() {
- featurePrefix = branchUtil.getPrefixFeature();
- releasePrefix = branchUtil.getPrefixRelease();
- hotfixPrefix = branchUtil.getPrefixHotfix();
- bugfixPrefix = branchUtil.getPrefixBugfix();
- masterBranch = branchUtil.getBranchnameMaster();
- developBranch = branchUtil.getBranchnameDevelop();
-
- currentBranchName = branchUtil.getCurrentBranchName();
}
public void runAction(Project project, final String baseBranchName, final String branchName, @Nullable final Runnable callInAwtLater){
diff --git a/src/main/java/gitflow/actions/GitflowPopupGroup.java b/src/main/java/gitflow/actions/GitflowPopupGroup.java
index 9200ceb..1d5cae8 100644
--- a/src/main/java/gitflow/actions/GitflowPopupGroup.java
+++ b/src/main/java/gitflow/actions/GitflowPopupGroup.java
@@ -1,17 +1,12 @@
package gitflow.actions;
-import com.intellij.diff.merge.TextMergeViewer;
-import com.intellij.icons.AllIcons;
import com.intellij.openapi.actionSystem.ActionGroup;
-import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.DefaultActionGroup;
import com.intellij.openapi.project.Project;
-import com.intellij.ui.LayeredIcon;
-import git4idea.branch.GitBranchUtil;
+import git4idea.GitUtil;
import git4idea.repo.GitRepository;
import git4idea.repo.GitRepositoryManager;
import org.jetbrains.annotations.NotNull;
-import git4idea.GitUtil;
import java.util.Iterator;
import java.util.List;
@@ -26,25 +21,27 @@ public class GitflowPopupGroup {
GitRepositoryManager myRepositoryManager;
List gitRepositories;
- public GitflowPopupGroup(@NotNull Project project) {
+ public GitflowPopupGroup(@NotNull Project project, boolean includeAdvanced) {
myProject = project;
//fetch all the git repositories from the project;
myRepositoryManager = GitUtil.getRepositoryManager(project);
gitRepositories = myRepositoryManager.getRepositories();
- createActionGroup();
+ createActionGroup(includeAdvanced);
}
/**
* Generates the popup actions for the widget
*/
- private void createActionGroup(){
+ private void createActionGroup(boolean includeAdvanced){
actionGroup = new DefaultActionGroup(null, false);
if (gitRepositories.size() == 1){
- ActionGroup repoActions = (new RepoActions(myProject, gitRepositories.get(0))).getRepoActionGroup();
+ ActionGroup repoActions =
+ (new RepoActions(myProject, gitRepositories.get(0)))
+ .getRepoActionGroup(includeAdvanced);
actionGroup.addAll(repoActions);
}
else{
diff --git a/src/main/java/gitflow/actions/InitRepoAction.java b/src/main/java/gitflow/actions/InitRepoAction.java
index b8ca252..3f3ac9f 100644
--- a/src/main/java/gitflow/actions/InitRepoAction.java
+++ b/src/main/java/gitflow/actions/InitRepoAction.java
@@ -16,18 +16,26 @@
public class InitRepoAction extends GitflowAction {
InitRepoAction() {
- super("Init Repo");
+ this( "Init Repo");
+ }
+
+ InitRepoAction(String actionName) {
+ this(null, "Init Repo");
}
InitRepoAction(GitRepository repo) {
- super(repo,"Init Repo");
+ this(repo,"Init Repo");
+ }
+
+ InitRepoAction(GitRepository repo, String actionName) {
+ super(repo, actionName);
}
@Override
public void update(@NotNull AnActionEvent e) {
GitflowBranchUtil branchUtil = GitflowBranchUtilManager.getBranchUtil(myRepo);
- //Disable and hide when gitflow has not been setup
+ // Only show when gitflow isn't setup
if (branchUtil.hasGitflow()) {
e.getPresentation().setEnabledAndVisible(false);
} else {
@@ -44,17 +52,19 @@ public void actionPerformed(AnActionEvent e) {
if(optionsDialog.isOK()) {
final GitflowErrorsListener errorLineHandler = new GitflowErrorsListener(myProject);
- final LineHandler localLineHandler = new LineHandler();
+ final GitflowLineHandler localLineHandler = getLineHandler();
final GitflowInitOptions initOptions = optionsDialog.getOptions();
- new Task.Backgroundable(myProject,"Initializing repo",false){
+ new Task.Backgroundable(myProject, getTitle(),false){
@Override
public void run(@NotNull ProgressIndicator indicator) {
- GitCommandResult result = myGitflow.initRepo(myRepo, initOptions, errorLineHandler, localLineHandler);
+ GitCommandResult result =
+ executeCommand(initOptions, errorLineHandler,
+ localLineHandler);
if (result.success()) {
- String publishedFeatureMessage = String.format("Initialized gitflow in repo " + myRepo.getRoot().getPresentableName() );
- NotifyUtil.notifySuccess(myProject, "", publishedFeatureMessage);
+ String successMessage = getSuccessMessage();
+ NotifyUtil.notifySuccess(myProject, "", successMessage);
} else {
NotifyUtil.notifyError(myProject, "Error", "Please have a look at the Version Control console for more details");
}
@@ -68,6 +78,25 @@ public void run(@NotNull ProgressIndicator indicator) {
}
+ protected String getSuccessMessage() {
+ return "Initialized gitflow in repo " + myRepo.getRoot().getPresentableName();
+ }
+
+ protected GitCommandResult executeCommand(GitflowInitOptions initOptions,
+ GitflowErrorsListener errorLineHandler,
+ GitflowLineHandler localLineHandler) {
+ return myGitflow.initRepo(myRepo, initOptions, errorLineHandler, localLineHandler);
+ }
+
+ protected String getTitle() {
+ return "Initializing Repo";
+ }
+
+ protected GitflowLineHandler getLineHandler() {
+ return new LineHandler();
+ }
+
+
private class LineHandler extends GitflowLineHandler {
@Override
public void onLineAvailable(String line, Key outputType) {
diff --git a/src/main/java/gitflow/actions/PublishBugfixAction.java b/src/main/java/gitflow/actions/PublishBugfixAction.java
index 7aec064..24f44da 100644
--- a/src/main/java/gitflow/actions/PublishBugfixAction.java
+++ b/src/main/java/gitflow/actions/PublishBugfixAction.java
@@ -24,14 +24,14 @@ public void actionPerformed(AnActionEvent anActionEvent) {
super.actionPerformed(anActionEvent);
GitflowConfigUtil gitflowConfigUtil = GitflowConfigUtil.getInstance(myProject, myRepo);
- final String bugfixName = gitflowConfigUtil.getBugfixNameFromBranch(currentBranchName);
+ final String bugfixName = gitflowConfigUtil.getBugfixNameFromBranch(branchUtil.getCurrentBranchName());
new Task.Backgroundable(myProject,"Publishing bugfix "+bugfixName,false){
@Override
public void run(@NotNull ProgressIndicator indicator) {
GitCommandResult result = myGitflow.publishBugfix(myRepo, bugfixName,new GitflowErrorsListener(myProject));
if (result.success()) {
- String publishedBugfixMessage = String.format("A new remote branch '%s%s' was created", bugfixPrefix, bugfixName);
+ String publishedBugfixMessage = String.format("A new remote branch '%s%s' was created", branchUtil.getPrefixBugfix(), bugfixName);
NotifyUtil.notifySuccess(myProject, bugfixName, publishedBugfixMessage);
}
else {
diff --git a/src/main/java/gitflow/actions/PublishFeatureAction.java b/src/main/java/gitflow/actions/PublishFeatureAction.java
index fdc41bc..51e4aad 100644
--- a/src/main/java/gitflow/actions/PublishFeatureAction.java
+++ b/src/main/java/gitflow/actions/PublishFeatureAction.java
@@ -23,7 +23,7 @@ public void actionPerformed(AnActionEvent anActionEvent) {
super.actionPerformed(anActionEvent);
GitflowConfigUtil gitflowConfigUtil = GitflowConfigUtil.getInstance(myProject, myRepo);
- final String featureName= gitflowConfigUtil.getFeatureNameFromBranch(currentBranchName);
+ final String featureName= gitflowConfigUtil.getFeatureNameFromBranch(branchUtil.getCurrentBranchName());
new Task.Backgroundable(myProject,"Publishing feature "+featureName,false){
@Override
@@ -31,7 +31,7 @@ public void run(@NotNull ProgressIndicator indicator) {
GitCommandResult result = myGitflow.publishFeature(myRepo, featureName,new GitflowErrorsListener(myProject));
if (result.success()) {
- String publishedFeatureMessage = String.format("A new remote branch '%s%s' was created", featurePrefix, featureName);
+ String publishedFeatureMessage = String.format("A new remote branch '%s%s' was created", branchUtil.getPrefixFeature(), featureName);
NotifyUtil.notifySuccess(myProject, featureName, publishedFeatureMessage);
}
else {
diff --git a/src/main/java/gitflow/actions/PublishHotfixAction.java b/src/main/java/gitflow/actions/PublishHotfixAction.java
index 599091b..4cfebf4 100644
--- a/src/main/java/gitflow/actions/PublishHotfixAction.java
+++ b/src/main/java/gitflow/actions/PublishHotfixAction.java
@@ -24,7 +24,7 @@ public void actionPerformed(AnActionEvent anActionEvent) {
super.actionPerformed(anActionEvent);
GitflowConfigUtil gitflowConfigUtil = GitflowConfigUtil.getInstance(myProject, myRepo);
- final String hotfixName = gitflowConfigUtil.getHotfixNameFromBranch(currentBranchName);
+ final String hotfixName = gitflowConfigUtil.getHotfixNameFromBranch(branchUtil.getCurrentBranchName());
final GitflowErrorsListener errorLineHandler = new GitflowErrorsListener(myProject);
new Task.Backgroundable(myProject, "Publishing hotfix " + hotfixName, false) {
@@ -33,7 +33,7 @@ public void run(@NotNull ProgressIndicator indicator) {
GitCommandResult result = myGitflow.publishHotfix(myRepo, hotfixName, errorLineHandler);
if (result.success()) {
- String publishedHotfixMessage = String.format("A new remote branch '%s%s' was created", hotfixPrefix, hotfixName);
+ String publishedHotfixMessage = String.format("A new remote branch '%s%s' was created", branchUtil.getPrefixHotfix(), hotfixName);
NotifyUtil.notifySuccess(myProject, hotfixName, publishedHotfixMessage);
} else {
NotifyUtil.notifyError(myProject, "Error", "Please have a look at the Version Control console for more details");
diff --git a/src/main/java/gitflow/actions/PublishReleaseAction.java b/src/main/java/gitflow/actions/PublishReleaseAction.java
index e12b2fc..cb1eb0e 100644
--- a/src/main/java/gitflow/actions/PublishReleaseAction.java
+++ b/src/main/java/gitflow/actions/PublishReleaseAction.java
@@ -24,7 +24,7 @@ public void actionPerformed(AnActionEvent anActionEvent) {
super.actionPerformed(anActionEvent);
GitflowConfigUtil gitflowConfigUtil = GitflowConfigUtil.getInstance(myProject, myRepo);
- final String releaseName= gitflowConfigUtil.getReleaseNameFromBranch(currentBranchName);
+ final String releaseName= gitflowConfigUtil.getReleaseNameFromBranch(branchUtil.getCurrentBranchName());
final GitflowErrorsListener errorLineHandler = new GitflowErrorsListener(myProject);
new Task.Backgroundable(myProject,"Publishing release "+releaseName,false){
@@ -33,7 +33,7 @@ public void run(@NotNull ProgressIndicator indicator) {
GitCommandResult result = myGitflow.publishRelease(myRepo, releaseName, errorLineHandler);
if (result.success()) {
- String publishedReleaseMessage = String.format("A new remote branch '%s%s' was created", releasePrefix, releaseName);
+ String publishedReleaseMessage = String.format("A new remote branch '%s%s' was created", branchUtil.getPrefixRelease(), releaseName);
NotifyUtil.notifySuccess(myProject, releaseName, publishedReleaseMessage);
}
else {
diff --git a/src/main/java/gitflow/actions/ReInitRepoAction.java b/src/main/java/gitflow/actions/ReInitRepoAction.java
new file mode 100644
index 0000000..c63fdc1
--- /dev/null
+++ b/src/main/java/gitflow/actions/ReInitRepoAction.java
@@ -0,0 +1,51 @@
+package gitflow.actions;
+
+import com.intellij.openapi.actionSystem.AnActionEvent;
+import git4idea.commands.GitCommandResult;
+import git4idea.repo.GitRepository;
+import gitflow.GitflowInitOptions;
+import org.jetbrains.annotations.NotNull;
+
+public class ReInitRepoAction extends InitRepoAction {
+ ReInitRepoAction() {
+ super("Re-init Repo");
+ }
+
+ ReInitRepoAction(GitRepository repo) {
+ super(repo, "Re-init Repo");
+ }
+
+ @Override
+ public void update(@NotNull AnActionEvent e) {
+ gitflow.GitflowBranchUtil branchUtil = gitflow.GitflowBranchUtilManager.getBranchUtil(myRepo);
+
+ // Only show when gitflow is setup
+ if (branchUtil.hasGitflow()) {
+ e.getPresentation().setEnabledAndVisible(true);
+ } else {
+ e.getPresentation().setEnabledAndVisible(false);
+ }
+ }
+
+ @Override
+ protected String getSuccessMessage() {
+ return "Re-initialized gitflow in repo " + myRepo.getRoot().getPresentableName();
+ }
+
+ @Override
+ protected GitCommandResult executeCommand(GitflowInitOptions initOptions,
+ GitflowErrorsListener errorLineHandler,
+ GitflowLineHandler localLineHandler) {
+ return myGitflow.reInitRepo(myRepo, initOptions, errorLineHandler, localLineHandler);
+ }
+
+ @Override
+ protected String getTitle() {
+ return "Re-initializing Repo";
+ }
+
+ @Override
+ protected GitflowLineHandler getLineHandler() {
+ return new GitflowErrorsListener(myProject);
+ }
+}
diff --git a/src/main/java/gitflow/actions/RepoActions.java b/src/main/java/gitflow/actions/RepoActions.java
index e400e79..f31a1ac 100644
--- a/src/main/java/gitflow/actions/RepoActions.java
+++ b/src/main/java/gitflow/actions/RepoActions.java
@@ -2,10 +2,7 @@
import com.intellij.dvcs.ui.BranchActionGroup;
import com.intellij.dvcs.ui.PopupElementWithAdditionalInfo;
-import com.intellij.openapi.actionSystem.AnAction;
-import com.intellij.openapi.actionSystem.AnActionEvent;
-import com.intellij.openapi.actionSystem.DefaultActionGroup;
-import com.intellij.openapi.actionSystem.Separator;
+import com.intellij.openapi.actionSystem.*;
import com.intellij.openapi.fileEditor.FileEditorManagerEvent;
import com.intellij.openapi.fileEditor.FileEditorManagerListener;
import com.intellij.openapi.project.Project;
@@ -20,7 +17,6 @@
class RepoActions extends BranchActionGroup implements PopupElementWithAdditionalInfo, FileEditorManagerListener {
Project myProject;
GitRepository myRepo;
- private final ArrayList repoActions;
RepoActions(@NotNull Project project, @NotNull GitRepository repo) {
myProject = project;
@@ -30,11 +26,9 @@ class RepoActions extends BranchActionGroup implements PopupElementWithAdditiona
getTemplatePresentation().setText(repoName, false); // no mnemonics
this.updateFavoriteIcon();
project.getMessageBus().connect().subscribe(FileEditorManagerListener.FILE_EDITOR_MANAGER, this);
-
- repoActions = getRepoActions();
}
- public ArrayList getRepoActions(){
+ public ArrayList getRepoActions(boolean includeAdvanced){
ArrayList actionList = new ArrayList();
actionList.add(new InitRepoAction(myRepo));
@@ -66,13 +60,26 @@ public ArrayList getRepoActions(){
actionList.add(new FinishHotfixAction(myRepo));
actionList.add(new PublishHotfixAction(myRepo));
+ if (includeAdvanced) {
+ actionList.add(new Separator("Advanced"));
+
+ actionList.add(new ActionGroup("Advanced", true) {
+ @NotNull
+ @Override
+ public AnAction[] getChildren(@Nullable AnActionEvent anActionEvent) {
+ AnAction initRepoAction = new ReInitRepoAction(myRepo);
+ return new AnAction[] { initRepoAction };
+ }
+ });
+ }
+
return actionList;
}
- public DefaultActionGroup getRepoActionGroup(){
+ public DefaultActionGroup getRepoActionGroup(boolean includeAdvanced){
DefaultActionGroup actionGroup = new DefaultActionGroup();
- Iterator actionsIterator = this.getRepoActions().iterator();
+ Iterator actionsIterator = this.getRepoActions(includeAdvanced).iterator();
while(actionsIterator.hasNext()){
AnAction action = (AnAction) actionsIterator.next();
actionGroup.add(action);
@@ -84,9 +91,8 @@ public DefaultActionGroup getRepoActionGroup(){
@NotNull
@Override
public AnAction[] getChildren(@Nullable AnActionEvent e) {
- ArrayList children = new ArrayList(this.repoActions);
-
- return children.toArray(new AnAction[0]);
+ ArrayList children = this.getRepoActions(false);
+ return children.toArray(new AnAction[children.size()]);
}
@Override
diff --git a/src/main/java/gitflow/actions/StartBugfixAction.java b/src/main/java/gitflow/actions/StartBugfixAction.java
index 55352ea..fbe31d2 100644
--- a/src/main/java/gitflow/actions/StartBugfixAction.java
+++ b/src/main/java/gitflow/actions/StartBugfixAction.java
@@ -55,7 +55,7 @@ private GitCommandResult createBugfixBranch(String baseBranchName, String bugfix
GitCommandResult result = myGitflow.startBugfix(myRepo, bugfixName, baseBranchName, errorListener);
if (result.success()) {
- String startedBugfixMessage = String.format("A new branch '%s%s' was created, based on '%s'", bugfixPrefix, bugfixName, baseBranchName);
+ String startedBugfixMessage = String.format("A new branch '%s%s' was created, based on '%s'", branchUtil.getPrefixBugfix(), bugfixName, baseBranchName);
NotifyUtil.notifySuccess(myProject, bugfixName, startedBugfixMessage);
} else {
NotifyUtil.notifyError(myProject, "Error", "Please have a look at the Version Control console for more details");
diff --git a/src/main/java/gitflow/actions/StartFeatureAction.java b/src/main/java/gitflow/actions/StartFeatureAction.java
index 4c9825a..f9f735f 100644
--- a/src/main/java/gitflow/actions/StartFeatureAction.java
+++ b/src/main/java/gitflow/actions/StartFeatureAction.java
@@ -55,7 +55,7 @@ private GitCommandResult createFeatureBranch(String baseBranchName, String featu
GitCommandResult result = myGitflow.startFeature(myRepo, featureName, baseBranchName, errorListener);
if (result.success()) {
- String startedFeatureMessage = String.format("A new branch '%s%s' was created, based on '%s'", featurePrefix, featureName, baseBranchName);
+ String startedFeatureMessage = String.format("A new branch '%s%s' was created, based on '%s'", branchUtil.getPrefixFeature(), featureName, baseBranchName);
NotifyUtil.notifySuccess(myProject, featureName, startedFeatureMessage);
} else {
NotifyUtil.notifyError(myProject, "Error", "Please have a look at the Version Control console for more details");
diff --git a/src/main/java/gitflow/actions/StartHotfixAction.java b/src/main/java/gitflow/actions/StartHotfixAction.java
index c36cb40..d4e4296 100644
--- a/src/main/java/gitflow/actions/StartHotfixAction.java
+++ b/src/main/java/gitflow/actions/StartHotfixAction.java
@@ -58,7 +58,7 @@ private GitCommandResult createHotfixBranch(String baseBranchName, String hotfix
if (result.success()) {
String startedHotfixMessage = String.format("A new hotfix '%s%s' was created, based on '%s'",
- hotfixPrefix, hotfixBranchName, baseBranchName);
+ branchUtil.getPrefixHotfix(), hotfixBranchName, baseBranchName);
NotifyUtil.notifySuccess(myProject, hotfixBranchName, startedHotfixMessage);
} else {
NotifyUtil.notifyError(myProject, "Error", "Please have a look at the Version Control console for more details");
diff --git a/src/main/java/gitflow/actions/StartReleaseAction.java b/src/main/java/gitflow/actions/StartReleaseAction.java
index ab50f17..9821bd2 100644
--- a/src/main/java/gitflow/actions/StartReleaseAction.java
+++ b/src/main/java/gitflow/actions/StartReleaseAction.java
@@ -41,7 +41,7 @@ public void run(@NotNull ProgressIndicator indicator) {
GitCommandResult result= myGitflow.startRelease(myRepo, releaseName, errorLineHandler);
if (result.success()) {
- String startedReleaseMessage = String.format("A new release '%s%s' was created, based on '%s'", releasePrefix, releaseName, developBranch);
+ String startedReleaseMessage = String.format("A new release '%s%s' was created, based on '%s'", branchUtil.getPrefixRelease(), releaseName, branchUtil.getBranchnameDevelop());
NotifyUtil.notifySuccess(myProject, releaseName, startedReleaseMessage);
}
else {
diff --git a/src/main/java/gitflow/actions/TrackBugfixAction.java b/src/main/java/gitflow/actions/TrackBugfixAction.java
index e7a3d93..51a8657 100644
--- a/src/main/java/gitflow/actions/TrackBugfixAction.java
+++ b/src/main/java/gitflow/actions/TrackBugfixAction.java
@@ -34,7 +34,7 @@ public void actionPerformed(AnActionEvent e) {
//get only the branches with the proper prefix
for (Iterator i = remoteBranches.iterator(); i.hasNext(); ) {
String item = i.next();
- if (item.contains(bugfixPrefix)) {
+ if (item.contains(branchUtil.getPrefixBugfix())) {
remoteBugfixBranches.add(item);
}
}
@@ -56,7 +56,7 @@ public void actionPerformed(AnActionEvent e) {
public void run(@NotNull ProgressIndicator indicator) {
GitCommandResult result = myGitflow.trackBugfix(myRepo, bugfixName, remote, errorLineHandler);
if (result.success()) {
- String trackedBugfixMessage = String.format("A new branch '%s%s' was created", bugfixPrefix, bugfixName);
+ String trackedBugfixMessage = String.format("A new branch '%s%s' was created", branchUtil.getPrefixBugfix(), bugfixName);
NotifyUtil.notifySuccess(myProject, bugfixName, trackedBugfixMessage);
} else {
NotifyUtil.notifyError(myProject, "Error", "Please have a look at the Version Control console for more details");
diff --git a/src/main/java/gitflow/actions/TrackFeatureAction.java b/src/main/java/gitflow/actions/TrackFeatureAction.java
index 0e9ee8d..ee8eaa9 100644
--- a/src/main/java/gitflow/actions/TrackFeatureAction.java
+++ b/src/main/java/gitflow/actions/TrackFeatureAction.java
@@ -34,7 +34,7 @@ public void actionPerformed(AnActionEvent e) {
//get only the branches with the proper prefix
for(Iterator i = remoteBranches.iterator(); i.hasNext(); ) {
String item = i.next();
- if (item.contains(featurePrefix)){
+ if (item.contains(branchUtil.getPrefixFeature())){
remoteFeatureBranches.add(item);
}
}
@@ -56,7 +56,7 @@ public void run(@NotNull ProgressIndicator indicator) {
GitCommandResult result = myGitflow.trackFeature(myRepo, featureName, remote, errorLineHandler);
if (result.success()) {
- String trackedFeatureMessage = String.format("A new branch '%s%s' was created", featurePrefix, featureName);
+ String trackedFeatureMessage = String.format("A new branch '%s%s' was created", branchUtil.getPrefixFeature(), featureName);
NotifyUtil.notifySuccess(myProject, featureName, trackedFeatureMessage);
}
else {
diff --git a/src/main/java/gitflow/actions/TrackReleaseAction.java b/src/main/java/gitflow/actions/TrackReleaseAction.java
index 74f9037..aa4e79d 100644
--- a/src/main/java/gitflow/actions/TrackReleaseAction.java
+++ b/src/main/java/gitflow/actions/TrackReleaseAction.java
@@ -33,7 +33,7 @@ public void actionPerformed(AnActionEvent e) {
//get only the branches with the proper prefix
for(Iterator i = remoteBranches.iterator(); i.hasNext(); ) {
String item = i.next();
- if (item.contains(releasePrefix)){
+ if (item.contains(branchUtil.getPrefixRelease())){
remoteReleaseBranches.add(item);
}
}
@@ -54,7 +54,7 @@ public void run(@NotNull ProgressIndicator indicator) {
GitCommandResult result = myGitflow.trackRelease(myRepo, releaseName, errorLineHandler);
if (result.success()) {
- String trackedReleaseMessage = String.format(" A new remote tracking branch '%s%s' was created", releasePrefix, releaseName);
+ String trackedReleaseMessage = String.format(" A new remote tracking branch '%s%s' was created", branchUtil.getPrefixRelease(), releaseName);
NotifyUtil.notifySuccess(myProject, releaseName, trackedReleaseMessage);
}
else {
diff --git a/src/main/java/gitflow/ui/AbstractBranchStartDialog.form b/src/main/java/gitflow/ui/AbstractBranchStartDialog.form
index 77a24fe..0b2243d 100644
--- a/src/main/java/gitflow/ui/AbstractBranchStartDialog.form
+++ b/src/main/java/gitflow/ui/AbstractBranchStartDialog.form
@@ -3,7 +3,7 @@
-
+
@@ -26,7 +26,7 @@
-
+
diff --git a/src/main/java/gitflow/ui/AbstractBranchStartDialog.java b/src/main/java/gitflow/ui/AbstractBranchStartDialog.java
index a8f086d..738a984 100644
--- a/src/main/java/gitflow/ui/AbstractBranchStartDialog.java
+++ b/src/main/java/gitflow/ui/AbstractBranchStartDialog.java
@@ -24,6 +24,7 @@ public abstract class AbstractBranchStartDialog extends DialogWrapper {
private JComboBox branchFromCombo;
private JLabel branchNameLabel;
private JLabel spacesLabel;
+ private JLabel branchFromTitle;
private Project project;
protected GitRepository myRepo;
@@ -71,6 +72,15 @@ public void validateBranchName() {
}
}
});
+
+ if (showBranchFromCombo() == false){
+ branchFromTitle.setVisible(false);
+ branchFromCombo.setVisible(false);
+ }
+ }
+
+ protected boolean showBranchFromCombo(){
+ return true;
}
@Override
diff --git a/src/main/java/gitflow/ui/GitflowStartHotfixDialog.java b/src/main/java/gitflow/ui/GitflowStartHotfixDialog.java
index 6e2076d..158cb6b 100644
--- a/src/main/java/gitflow/ui/GitflowStartHotfixDialog.java
+++ b/src/main/java/gitflow/ui/GitflowStartHotfixDialog.java
@@ -11,6 +11,10 @@ public GitflowStartHotfixDialog(Project project, GitRepository repo) {
super(project, repo);
}
+ protected boolean showBranchFromCombo(){
+ return false;
+ }
+
@Override
protected String getLabel() {
return "hotfix";
diff --git a/src/main/java/gitflow/ui/GitflowWidget.java b/src/main/java/gitflow/ui/GitflowWidget.java
index 6669ee9..fc0930d 100644
--- a/src/main/java/gitflow/ui/GitflowWidget.java
+++ b/src/main/java/gitflow/ui/GitflowWidget.java
@@ -151,14 +151,7 @@ private void update() {
Project project = getProject();
//repopulate the branchUtil
- Future f = GitflowBranchUtilManager.update(project);
- try {
- f.get();
- } catch (InterruptedException e) {
- e.printStackTrace();
- } catch (ExecutionException e) {
- e.printStackTrace();
- }
+ GitflowBranchUtilManager.update(project);
if (project == null) {
emptyTextAndTooltip();
@@ -171,7 +164,8 @@ private void update() {
return;
}
- popupGroup = new GitflowPopupGroup(project);
+ //No advanced features in the status-bar widget
+ popupGroup = new GitflowPopupGroup(project, false);
GitflowBranchUtil gitflowBranchUtil = GitflowBranchUtilManager.getBranchUtil(repo);
boolean hasGitflow = gitflowBranchUtil.hasGitflow();
diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml
index b309c5d..a2cac2d 100644
--- a/src/main/resources/META-INF/plugin.xml
+++ b/src/main/resources/META-INF/plugin.xml
@@ -15,44 +15,51 @@
+ text="Gitflow Operations Popup..." />
+ text="Initialize Gitflow Repository..." />
+
+ text="Start Feature..." />
+ text="Finish Feature" />
+ text="Publish Feature" />
+ text="Track Feature..." />
+ text="Start Release..." />
+ text="Finish Release" />
+ text="Publish Release" />
+ text="Track Release..." />
+ text="Start Hotfix..." />
+ text="Finish Hotfix" />
+ text="Publish Hotfix" />
+ text="Start Bugfix..." />
+ text="Finish Bugfix" />
+ text="Publish Bugfix" />
+ text="Track Bugfix..." />
+
+