How to see Mercurial commands issued by Tortoise HG?

ぃ、小莉子 提交于 2019-12-08 17:12:01

问题


I there a way to see what Mercurial commands are issued by Tortoise HG? 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.


回答1:


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. 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

To see print statements, you typically have to set THGDEBUG in your environment, and run hgtk with the --nofork option.

Shelve in particular is difficult to intercept, because nearly all of that code is internal to TortoiseHg. We have a local copy of the shelve extension and call into it directly.




回答2:


You can only see the stderr if some command trigger a problem, by activating DEBUG_THG.

But as far as I know, there is no command log for TortoiseHg.

And TortoiseGit is not very strong on this feature either.




回答3:


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:

TortoiseHG has a "log" view which can be activated with this toolbar button: .

It will show many hg commands as they are run, including their output.

This is the same as the View menu / Show Log option (or ^L).



来源:https://stackoverflow.com/questions/2599888/how-to-see-mercurial-commands-issued-by-tortoise-hg

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!