简体   繁体   English

如何查看Tortoise HG发出的Mercurial命令?

[英]How to see Mercurial commands issued by Tortoise HG?

I there a way to see what Mercurial commands are issued by Tortoise HG? 我有办法查看Tortoise HG发出哪些Mercurial命令吗? For instance, if I use the Shelve command in Tortoise, I'd like to see how (and if) it calls 'hg shelve' under the hood. 例如,如果我在Tortoise中使用Shelve命令,我想看看它在后台如何(以及是否)称呼“ hg shelve”。

In some tools, there's a "View->Always Show Output" option. 在某些工具中,有一个“查看->始终显示输出”选项。 It causes commands to run in a console window. 它使命令在控制台窗口中运行。 Though often the displayed command line is truncated because it could contain passwords. 虽然通常显示的命令行会被截断,因为它可能包含密码。

TortoiseHg uses Mercurial at multiple API layers, so there's no universal place to get all the commands it issues. TortoiseHg在多个API层使用Mercurial,因此没有通用的位置来获取它发出的所有命令。 But a couple print statements could get you pretty far. 但是,一些打印语句可以使您受益匪浅。

tortoisehg/hgtk/hgcmd.py - in CmdRunner::execute(), print cmdline tortoisehg/util/hglib.py - in hgcmd_toq(), print args tortoisehg / hgtk / hgcmd.py-在CmdRunner :: execute()中,打印cmdline tortoisehg / util / hglib.py-在hgcmd_toq()中,打印args

To see print statements, you typically have to set THGDEBUG in your environment, and run hgtk with the --nofork option. 要查看打印语句,通常必须在环境中设置THGDEBUG,然后使用--nofork选项运行hgtk。

Shelve in particular is difficult to intercept, because nearly all of that code is internal to TortoiseHg. 特别是货架很难被拦截,因为几乎所有的代码都在TortoiseHg内部。 We have a local copy of the shelve extension and call into it directly. 我们有暂挂扩展的本地副本,并直接调用它。

You can only see the stderr if some command trigger a problem, by activating DEBUG_THG . 通过激活DEBUG_THG ,只有某些命令触发问题时,您才能看到stderr

But as far as I know, there is no command log for TortoiseHg . 但是据我所知, 没有TortoiseHg的命令日志

And TortoiseGit is not very strong on this feature either . 而且TortoiseGit在此功能上也不是很强大

I'm sure Steve Borho's answer is spot on but there is another simpler approach which might be 90% of what is needed in many cases: 我确定Steve Borho的答案正确的 ,但是还有另一种更简单的方法,在很多情况下可能需要90%的方法:

TortoiseHG has a "log" view which can be activated with this toolbar button: TortoiseHG具有一个“日志”视图,可以使用此工具栏按钮激活该视图: 在此处输入图片说明 .

It will show many hg commands as they are run, including their output. 它将在运行时显示许多hg命令,包括它们的输出。

This is the same as the View menu / Show Log option (or ^L ). 这与“查看”菜单/“显示日志”选项(或^L )相同。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Mercurial(hg)中,如果发出“hg push”,你如何看到将被推送的文件列表? - In Mercurial (hg), how do you see a list of files that will be pushed if an “hg push” is issued? 如何使用tortoise hg“作为存储库的一部分”来忽略kiln / mercurial中的文件 - how to ignore files in kiln/mercurial using tortoise hg “that are part of the repository” 如何使用Tortoise Hg(mercurial)手动将文件标记为已移动/重命名 - How to manually mark files as moved/renamed using Tortoise Hg (mercurial) 如何在Windows上安装tortoise hg Mercurial,虚拟环境 - How to install tortoise hg Mercurial on Windows, virtual environment Tortoise-Hg(mercurial)没有找到hg-git - Tortoise-Hg (mercurial) does not find hg-git 来自dos提示符的mercurial(hg)命令,该怎么办? - commands of mercurial(hg) from dos prompt, how do this? 如何检查在Mercurial / Tortoise Hg的两个修订版本之间更改了哪些文件? - how to check which files has been changed between two revisions in Mercurial / Tortoise Hg? 如何使用Tortoise HG和Mercurial将当前工作目录标记为稳定分支 - How mark the current working directory as stable branch using Tortoise HG and Mercurial 如何在mercurial / tortoise hg中生成每用户贡献图? - How can I generate per user contribution graph in mercurial/tortoise hg? 如何跳过乌龟HG中的subrepo - How to skip subrepo in tortoise hg
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM