Mercurial win安装:没有ini文件
我在 win xp 上安装了 Mercurial 1.5.1,但未创建 hg help config 中列出的文件。
即:
%USERPROFILE%.hgrc(这是有效的 Windows 文件名吗?)
%USERPROFILE%\Mercurial.ini
\Mercurial\Mercurial.ini
C:\Mercurial\Mercurial.ini(完全没有这样的目录)
%HOME%.hgrc(这个目录是什么)
%HOME%\Mercurial.ini
HKEY_LOCAL_MACHINE\SOFTWARE\Mercurial(未创建注册表)
.hg\hgrc(我必须手动创建此文件才能解决我的问题)
I installed mercurial 1.5.1 on win xp but the files listed in hg help config, were not created.
Namely:
%USERPROFILE%.hgrc (is that a valid windows file name?)
%USERPROFILE%\Mercurial.ini
\Mercurial\Mercurial.ini
C:\Mercurial\Mercurial.ini (no such directory altogether)
%HOME%.hgrc (what is this directory)
%HOME%\Mercurial.ini
HKEY_LOCAL_MACHINE\SOFTWARE\Mercurial (no registry created)
.hg\hgrc (i had to create this file manually to solve my problem)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
它们不应该自动创建。您可以在其中放置配置信息,具体取决于您希望其具有的范围:
C:\Mercurial\Mercurial.ini
- 如果您选择创建此内容,那么您放入的任何内容都会影响所有用户系统%USERPROFILE%\Mercurial.ini
- 如果您选择创建此系统,您放入其中的任何内容都只会影响您,但在与您交互的每个存储库中((存储库根))\ .hg\hgrc
- 如果您选择创建此文件,则无论您在其中放入什么,都只会影响您放置它的存储库,所以,这都是关于范围的。启用扩展之类的操作最好在 C:\Mercurial 中的系统全局中完成。像设置用户名这样的事情可能最好只为您自己完成,在
%USERPROFILE%\Mercurial.ini
中。保存存储库的密码(如果完成)可能会保存在该存储库.hg/hgrc
文件中。正如 Daniel 在评论中所解释的,
%USERPROFILE%
是环境变量的扩展。这是必要的,因为您的主目录位置会根据您拥有的 Windows 版本、管理员的配置方式以及您的姓名而有所不同。They're not supposed to be automatically created. They're places you can put configuration information depending on what scope you want it to have:
C:\Mercurial\Mercurial.ini
- If you choose to create this whatever you put in it affects all users on the systme%USERPROFILE%\Mercurial.ini
- If you choose to create this whatever you put in it affects only you, but in every repo with with you interact((repository root))\.hg\hgrc
- If you choose to create this whatever you put in it affects only the repository in which you placed itSo, it's all about scope. Something like enabling an extension might be best done system global in C:\Mercurial. Something like setting your username is probably best done only for you, in your
%USERPROFILE%\Mercurial.ini
. Saving a password for a repository (if done at all) probably goes inside that repos.hg/hgrc
file.As explained by Daniel in the comments,
%USERPROFILE%
is the expansion of an environment variable. That's necessary because your home directory location differs depending on what version of windows you have, how your administrator configured it, and your name.AFAIK,默认情况下不会创建这些文件。为了存储登录 ID,通常最好按照您所做的操作,特别是如果您所从事的每个项目都有不同的用户名。
否则,您可以在
C:\Documents and Settings\<用户名>\
(当您使用的是 Windows XP 时)或>C:\Users\<用户名>
(如果您使用的是 Windows Vista 或 Windows 7)AFAIK, the files are not created by default. For storing the login IDs, it's usually a good idea to do what you did, especially if you have a different username for each project you work on.
Otherwise, you could create a
Mercurial.ini
file underC:\Documents and Settings\<user name>\
(as you are using Windows XP) or underC:\Users\<user name>
(if you're using Windows Vista or Windows 7)