[英]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.