ignore certain mercurial commands in mercurial hook

女生的网名这么多〃 提交于 2019-12-05 12:42:13

Unfortunately the answer seems to be no. I just debugged into the hook mechanism of hg 3.1, and the information about which command was issued is not propagated into the hook function. The only way I can think of is to hack something ugly with the debugger api to extract informations from the call stack.

Another hack would be to inspect sys.argv, but I fear that this is also very unreliable (as it can't detect if something was executed via the Command Server).

BTW I used this snippet to attach a debugger:

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