禁用上下文菜单

As of version 1.5.0 and later, TortoiseSVN allows you to disable (actually, hide) context menu entries. Since this is a feature which should not be used lightly but only if there is a compelling reason, there is no GUI for this and it has to be done directly in the registry. This can be used to disable certain commands for users who should not use them. But please note that only the context menu entries in the explorer are hidden, and the commands are still available through other means, e.g. the command line or even other dialogs in TortoiseSVN itself!

控制上下文菜单显示的注册表键是HKEY_CURRENT_USER\Software\TortoiseSVN\ContextMenuEntriesMaskLowHKEY_CURRENT_USER\Software\TortoiseSVN\ContextMenuEntriesMaskHigh

每个注册表条目都是 DWORD 类型,每位对应一个指定的菜单项。置位意味着对应的菜单项禁用。

表 C.1. 菜单入口和取值

取值菜单入口
0x0000000000000001检出
0x0000000000000002更新
0x0000000000000004提交
0x0000000000000008添加
0x0000000000000010恢复
0x0000000000000020清理
0x0000000000000040解决
0x0000000000000080切换
0x0000000000000100导入
0x0000000000000200输出
0x0000000000000400在当前位置创建版本库
0x0000000000000800分支/标记
0x0000000000001000合并
0x0000000000002000删除
0x0000000000004000改名
0x0000000000008000更新到版本
0x0000000000010000差异
0x0000000000020000显示日志
0x0000000000040000编辑冲突
0x0000000000080000重新定位
0x0000000000100000检查修改
0x0000000000200000忽略
0x0000000000400000版本库浏览器
0x0000000000800000追溯
0x0000000001000000创建补丁
0x0000000002000000应用补丁(Apply Patch)
0x0000000004000000版本图
0x0000000008000000
0x0000000010000000删除锁
0x0000000020000000属性
0x0000000040000000与 URL 比较
0x0000000080000000删除未版本控制的项目
0x0000000100000000合并所有
0x0000000200000000与前一版本比较差异
0x0000000400000000粘贴
0x0000000800000000升级工作副本
0x0000001000000000稍候比较
0x0000002000000000与“文件名” 比较
0x0000004000000000统一差异
0x2000000000000000设置
0x4000000000000000帮助
0x8000000000000000关于

Example: to disable the “Relocate” the “Delete unversioned items” and the “Settings” menu entries, add the values assigned to the entries like this:

  1. 0x0000000000080000
  2. + 0x0000000080000000
  3. + 0x2000000000000000
  4. = 0x2000000080080000

The lower DWORD value (0x80080000) must then be stored in HKEY_CURRENT_USER\Software\TortoiseSVN\ContextMenuEntriesMaskLow, the higher DWORD value (0x20000000) in HKEY_CURRENT_USER\Software\TortoiseSVN\ContextMenuEntriesMaskHigh.

简单删除这两个注册键,即可重新激活菜单项。