设置 Tortoise SVN Windows 7 热键

发布于 2024-10-19 04:01:11 字数 362 浏览 3 评论 0原文

如何为常用的 SVN 操作(例如 diff)设置一些热键?

目前要查看差异,我必须选择文件,然后右键单击,导航到 TortoiseSVN,然后选择差异操作。对于经常使用的东西来说,需要几个步骤。

相反,我想选择文件并使用热键(例如 Ctrl-Alt-F)来执行相同的 Diff 操作。

在寻找解决方案时,我发现有些人运行 AutoHotKey 脚本来执行类似的操作,但这似乎有点矫枉过正。

我制作了一个热键快捷方式(使用创建快捷方式的标准 Win 7 方法,然后调整其属性)来运行 TortoiseMerge,这是显示差异的工具,但这样的快捷方式会忽略当前文件选择并显示空白的 TortoiseMerge。

有什么想法可以尝试吗?

How would one go about setting up some hotkeys for commonly used SVN actions such as diff?

Currently to view diff, I have to select file(s), then right click, navigate to TortoiseSVN and then select Diff action. Quite a few steps for something used often.

Instead, I would like to select file and use hotkey(for example Ctrl-Alt-F) to do the same Diff action.

Searching for solutions, I have found some people running AutoHotKey scripts to do similar things, but it seems like an overkill.

I made a hotkey shortcut(using standard Win 7 method of creating a shortcut then adjusting its properties) to run TortoiseMerge, which is the tool that displays the diff, but such a shortcut ignores current file selection and brings up a blank TortoiseMerge.

Any ideas to try?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

提赋 2024-10-26 04:01:11

您可以修改 TortoiseSVN 上下文菜单并将您喜欢的命令放在上下文菜单的根目录中。这样您只需单击两次即可获得差异。我想没那么多。

TortoiseSVN 设置 - 上下文菜单

另一种选择是使用高级文件管理器(如 Total Commander 或 FreeCommander),它使您能够使用自定义热键定义自定义菜单命令。

在 Total Commander 中,这将是“更改开始菜单”:

  • 命令:C:\Program Files (x86)\TortoiseSVN\bin\TortoiseProc.exe
  • 参数:/command:diff /path:% P\%N
  • 快捷键:CRTL+ALT+F1

无论是 shell 上下文菜单还是热键,运行 TortoiseSVN 命令至少需要 2 个步骤:

  1. 选择文件(选择并右键单击打开上下文菜单是一个单一的操作)
  2. 运行命令(单击上下文菜单项或按快捷键)

从这个角度来看,这只是您个人喜好的问题:我应该单击两次还是应该单击一次然后让鼠标按键? <代码>;-)

You can modify the TortoiseSVN context menu and place your favorite commands at the root of the context menu. This way you have only to click twice for a diff. Not that much, I think.

TortoiseSVN Settings - Context Menu

Another option would be to use an advanced file manager (like Total Commander or FreeCommander) which enables you to define custom menu commands with custom hot keys.

In Total Commander this would be "Change Start Menu":

  • Command: C:\Program Files (x86)\TortoiseSVN\bin\TortoiseProc.exe
  • Parameters: /command:diff /path:%P\%N
  • Shortcut Key: CRTL+ALT+F1

Whether shell context menu or hotkey, you need at least 2 steps to run a TortoiseSVN command:

  1. Select the file (selecting and right clicking to open the context menu is a single action)
  2. Run the command (click on the context menu item or press the shortcut key)

From this point of view it's just a question of your personal preference: should I click twice or should I click once and leave the mouse for pressing a key? ;-)

执着的年纪 2024-10-26 04:01:11

Autohotkey 对于单个键来说有点过分了,但是您可以在单个脚本中收集可能在任何窗口类型中执行的操作的热键。因此,您可以让热键在一类窗口中执行相当复杂的操作,而相同的热键使用“#IfWinActive”指令在另一种窗口类型中执行不同的操作。

例如,此 URL 提到添加用于提交和更新的热键;你可以添加一个键来满足你的 diff 需要,也许还可以添加一个用于 log 或你经常执行的其他 svn 选项。

由于某种原因,在 Windows 7 中调出资源管理器上下文菜单对我来说速度很慢。添加这些热键确实改善了我的工作流程。

注意:您还可以在该 URL 的示例代码前添加以下前缀:

GroupAdd explorers, ahk_class ExploreWClass
GroupAdd explorers, ahk_class CabinetWClass

#IfWinActive ahk_group explorers

并添加后缀:

#IfWinActive

当 Windows 资源管理器获得焦点时,这些特定的热键将执行 TortoiseSVN 特定的命令,并在所有其他情况下传递。

Autohotkey is overkill for a single key, but you can collect the hotkeys for actions you might perform in any window type all in a single script. As a result, you can have hotkeys perform fairly complex actions in one class of windows, and the same hotkeys perform different actions in another window type using the '#IfWinActive' directive.

For example, this URL mentions adding hotkeys for commit and update; you could add a key for your diff need, and perhaps one for log or some other svn option you perform frequently.

For some reason, bringing up the explorer context menu is slow for me in Windows 7. Adding these hotkeys really improved my workflow.

Note: you can also prefix that URL's example code with the following:

GroupAdd explorers, ahk_class ExploreWClass
GroupAdd explorers, ahk_class CabinetWClass

#IfWinActive ahk_group explorers

And suffix it with:

#IfWinActive

And those specific hotkeys will execute the TortoiseSVN-specific commands when Windows Explorer has focus, and be passed through in all other cases.

汐鸠 2024-10-26 04:01:11

您可以尝试使用正确的参数直接调用该进程,而不必担心右键单击上下文菜单。

例如,我能够直接设置以下项目的快捷方式:

"C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe" /command:update /path:"c:\Source"

从那里,您可以从热键程序调用此快捷方式,或者如果您更喜欢开箱即用的解决方案,请将文件夹直接映射到任务栏(为了美观,我将我的任务栏标记为“o”)并将该快捷方式粘贴到此文件夹中。

理论上,每个存储库的每个操作都可以有一个快捷方式。

You could try directly calling the process with the correct parameters instead of worrying about right-click context menus.

For example, I was able to set up a shortcut directly to the following item:

"C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe" /command:update /path:"c:\Source"

From there, you can call this shortcut from your hotkey program, or if you prefer a out-of-the-box solution, map a folder directly to the task bar (I labeled mine "o" for aesthetics) and stick that shortcut in this folder.

Theoretically, you could have one shortcut per operation, per repository.

放飞的风筝 2024-10-26 04:01:11

从更普遍的角度来看这个问题,我会说这是一个工作流程问题。想必您想要找到一种更快的方法来查找差异的原因是因为您想要对多个文件执行此操作。在这种情况下,请转到工作副本的根目录并选择 TortoiseSVN ->检查修改。这将向您显示已更改文件的列表。获取差异,只需双击每个差异即可。

Looking at the problem more generally, I'd say that this is a workflow issue. Presumably the reason you want to find a quicker way of finding diffs is because you want to do it for a number of files. In that case, go to the root of your working copy and choose TortoiseSVN -> Check for modifications. That will show you a list of changed files. Do get the diffs, just double click on each.

你丑哭了我 2024-10-26 04:01:11

安装StExBar,然后添加diff/update/commit/...的命令并指定对应的TortoiseProc.exe 命令。
当然,还要为命令指定一个热键。

Install the StExBar, then add commands for diff/update/commit/... and specify the corresponding TortoiseProc.exe command.
And of course assign a hotkey for the command.

○闲身 2024-10-26 04:01:11

您可以使用上下文菜单快捷方式。
只需在资源管理器中打开代码文件夹并使用以下内容:

Commit: alt + F + C
update: alt + F + U
Check for updates: alt + F + T + F

因此您可以按上面的键盘快捷键来提交,而不必右键单击目录然后单击提交。

You can use context menu shortcuts.
Just open code folder in explorer and use below:

Commit: alt + F + C
update: alt + F + U
Check for updates: alt + F + T + F

So you can press above keyboard shortcuts to commit instead of having to right click directory then click commit.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文