From 2def6e2c6273ae04dfd1951aa712e428071675cc Mon Sep 17 00:00:00 2001 From: irengrig Date: Wed, 3 Oct 2012 18:13:23 +0400 Subject: [PATCH] IDEA-91595 Can't create patch in Changes view, Log tab --- .../src/git4idea/history/wholeTree/GitLogUI.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/git4idea/src/git4idea/history/wholeTree/GitLogUI.java b/plugins/git4idea/src/git4idea/history/wholeTree/GitLogUI.java index 63fc1ac85a77..c3c2e0482d3f 100644 --- a/plugins/git4idea/src/git4idea/history/wholeTree/GitLogUI.java +++ b/plugins/git4idea/src/git4idea/history/wholeTree/GitLogUI.java @@ -36,6 +36,7 @@ import com.intellij.openapi.util.*; import com.intellij.openapi.util.text.StringUtil; import com.intellij.openapi.vcs.*; import com.intellij.openapi.vcs.changes.Change; +import com.intellij.openapi.vcs.changes.actions.CreatePatchFromChangesAction; import com.intellij.openapi.vcs.changes.committed.CommittedChangesTreeBrowser; import com.intellij.openapi.vcs.changes.committed.RepositoryChangesBrowser; import com.intellij.openapi.vcs.changes.issueLinks.IssueLinkRenderer; @@ -830,7 +831,13 @@ public class GitLogUI implements Disposable { } } group.add(myCherryPickAction); - group.add(ActionManager.getInstance().getAction("ChangesView.CreatePatchFromChanges")); + group.add(new CreatePatchFromChangesAction() { + @Override + public void update(AnActionEvent e) { + Change[] changes; + e.getPresentation().setEnabled((changes = e.getData(VcsDataKeys.CHANGES)) != null && changes.length > 0); + } + }); group.add(new MyCheckoutRevisionAction()); group.add(new MyCheckoutNewBranchAction()); group.add(new MyCreateNewTagAction());