如何从命令提示符打开特定文件的 HG 存储库浏览器?
我知道 hgtk log 命令,但它适用于目录而不是文件。
如果我执行这样的操作,
hgtk log -R D:\bmutilities\big_repo\chrome\content\br_editor.js
它会抛出一个错误,说---找不到目录
但是如果在 D:\bmutilities\big_repo\chrome\content\
目录中运行 hgtk 命令,
hgtk log -R br_editor.js
它工作正常...
请提出建议????
I know about hgtk log command but it is working for directory not for a file.
If I execute something like this
hgtk log -R D:\bmutilities\big_repo\chrome\content\br_editor.js
It throws an error saying---directory not found
But if run hgtk command in D:\bmutilities\big_repo\chrome\content\
directory
hgtk log -R br_editor.js
it works fine...
Suggestions please ????
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用
--repository
或-R
选项指定存储库的路径。之后,文件名相对于该目录。从这个意义上说,hgtk -R
的工作方式类似于hg --cwd
,这意味着它实际上更改了当前工作目录。Mercurial 还有一个类似于 switch 的
--repository
(-R
) 命令,但这不会更改进程的当前工作目录。You use the
--repository
or-R
option to specify the path to the repository. After that, the filenames are relative to that directory. In this sense,hgtk -R
works likehg --cwd
meaning that it actually changes the current working directory.Mercurial also has a
--repository
(-R
) command like switch, but this does not change the current working directory of the process.更新
我现在更好地理解你的问题了。您的意思是,如果您不在 .hg 根文件夹下的文件夹中,则无法从命令行查看文件的历史记录。
这似乎是 Mercurial 的设计决定。
我只是确保在对特定文件执行
hgtk log
之前已 cd 到存储库内的文件夹。UPDATE
I understand your question better now. You mean that you cannot view the history of a file from the command line if you are not in a folder under the .hg root folder.
That appears to be a design decision by mercurial.
I just make sure I cd to a folder inside the repo before I do
hgtk log
on a specific file.