Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Stocker2013-08-15 13:09:21 +0000
committerRobin Stocker2013-08-15 13:14:57 +0000
commit85f17521576061d2facb8bbaf1bcee74c76c833c (patch)
treefc39d6dd340fba202f00b5d268fa6b864ff849c0 /org.eclipse.egit.ui/plugin.xml
parent9051a0667216ce8492a8056a2726ce7fc0ebe775 (diff)
downloadegit-85f17521576061d2facb8bbaf1bcee74c76c833c.tar.gz
egit-85f17521576061d2facb8bbaf1bcee74c76c833c.tar.xz
egit-85f17521576061d2facb8bbaf1bcee74c76c833c.zip
Only show Gerrit menu entries when Gerrit is configured
"Gerrit Configuration..." on a remote node in the repo view is the only Gerrit menu that's shown when a repo is not configured for Gerrit. To test whether Gerrit is configured, the following is used: * Is "gerrit.createchangeid" set to true in Git config? * Are there any remotes with a push refspec where the destination starts with "refs/for/"? Change-Id: Ie1f1d5df9a3989b32a1b892c6275615e1ddfb01b Signed-off-by: Robin Stocker <robin@nibor.org>
Diffstat (limited to 'org.eclipse.egit.ui/plugin.xml')
-rw-r--r--org.eclipse.egit.ui/plugin.xml64
1 files changed, 56 insertions, 8 deletions
diff --git a/org.eclipse.egit.ui/plugin.xml b/org.eclipse.egit.ui/plugin.xml
index 5bb0024f98..807577737d 100644
--- a/org.eclipse.egit.ui/plugin.xml
+++ b/org.eclipse.egit.ui/plugin.xml
@@ -2953,9 +2953,14 @@
value="1">
</count>
<iterate>
- <instanceof
- value="org.eclipse.egit.ui.internal.repository.tree.RepositoryNode">
- </instanceof>
+ <and>
+ <instanceof
+ value="org.eclipse.egit.ui.internal.repository.tree.RepositoryNode">
+ </instanceof>
+ <test
+ property="GitRepository.hasGerritConfiguration">
+ </test>
+ </and>
</iterate>
</and>
</visibleWhen>
@@ -2971,9 +2976,14 @@
value="1">
</count>
<iterate>
- <instanceof
- value="org.eclipse.egit.ui.internal.repository.tree.RepositoryNode">
- </instanceof>
+ <and>
+ <instanceof
+ value="org.eclipse.egit.ui.internal.repository.tree.RepositoryNode">
+ </instanceof>
+ <test
+ property="GitRepository.hasGerritConfiguration">
+ </test>
+ </and>
</iterate>
</and>
</visibleWhen>
@@ -3645,11 +3655,49 @@
commandId="org.eclipse.egit.ui.FetchGerritChange"
label="%FetchFromGerritCommand.label"
style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <and>
+ <count
+ value="1">
+ </count>
+ <iterate>
+ <adapt
+ type="org.eclipse.core.resources.IProject">
+ <test
+ property="GitResource.isShared">
+ </test>
+ <test
+ property="GitResource.hasGerritConfiguration">
+ </test>
+ </adapt>
+ </iterate>
+ </and>
+ </visibleWhen>
</command>
<command
commandId="org.eclipse.egit.ui.PushHeadToGerrit"
label="%PushToGerritMenu.label"
style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <and>
+ <count
+ value="1">
+ </count>
+ <iterate>
+ <adapt
+ type="org.eclipse.core.resources.IProject">
+ <test
+ property="GitResource.isShared">
+ </test>
+ <test
+ property="GitResource.hasGerritConfiguration">
+ </test>
+ </adapt>
+ </iterate>
+ </and>
+ </visibleWhen>
</command>
<separator
name="org.eclipse.egit.ui.remote.group1"
@@ -4514,14 +4562,14 @@
class="org.eclipse.egit.ui.internal.repository.tree.RepositoriesViewPropertyTester"
id="org.eclipse.egit.ui.RepositoryTester"
namespace="GitRepository"
- properties="isBare,isSafe,canCommit,canAmend,canResetHead,canStash,isRefCheckedOut,isLocalBranch,fetchExists,pushExists,canMerge,canAbortRebase,canContinueRebase,isSubmodule,containsHead"
+ properties="isBare,isSafe,canCommit,canAmend,canResetHead,canStash,isRefCheckedOut,isLocalBranch,fetchExists,pushExists,canMerge,canAbortRebase,canContinueRebase,isSubmodule,containsHead,hasGerritConfiguration"
type="org.eclipse.egit.ui.internal.repository.tree.RepositoryTreeNode">
</propertyTester>
<propertyTester
class="org.eclipse.egit.ui.internal.ResourcePropertyTester"
id="org.eclipse.egit.ui.ResourceTester"
namespace="GitResource"
- properties="isShared,isContainer,isSafe,canCommit,canAmend,canResetHead"
+ properties="isShared,isContainer,isSafe,canCommit,canAmend,canResetHead,hasGerritConfiguration"
type="org.eclipse.core.resources.IResource">
</propertyTester>
</extension>

Back to the top