Mercurial not working after TortoiseHg update

ぃ、小莉子 提交于 2019-12-06 19:27:23

问题


I recently updated TortoiseHg to 2.0.3 (with Mercurial 1.8.2). After updating, Mercurial no longer works via the command line (Windows 7 x64), but does work via the TortoiseHg GUI. Trying to use any Hg commands via the command line results in the error message 'hg' is not recognized as an internal or external command, operable program or batch file.'

I'm guessing I need to make some change to a setting in TortoiseHg or Windows 7 so that Windows will recognize hg commands, but I'm not sure what that change is. I am very new to using Hg - I installed it a few months ago (thus the need for an update), but only recently started using it.


回答1:


TortoiseHg v2.X.X no longer uses the hg command, instead try thg.

Your install path might be different, but typically thg.CMD exists at:

C:/Program Files/TortoiseHg/bin/

If you've installed Mercurial independent of TortoiseHg you may still have access to the hg executable, but most people just install TortoiseHg and take the associated copy of Mercurial, in which case you would need to use the thg commands.




回答2:


I fixed this by removing the "/" at the end of the Path:

From

"C:\Program Files\TortoiseHg\"

to

"C:\Program Files\TortoiseHg"



回答3:


I had to remove the leading quotation mark - the PATH variable contained:

...;"C:\Program Files\TortoiseHg

and I changed it to

...;C:\Program Files\TortoiseHg

to make it work with Red-Gate SQL Source control.



来源:https://stackoverflow.com/questions/5686959/mercurial-not-working-after-tortoisehg-update

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