Kev*_*Won 117 version-control mercurial
WindowsXP上的问题(可能会在所有Win安装上发生),第一次使用Mercurial.我在一个不明显的地方找到答案,所以我自己要问/回答这个问题,所以其他人不必像我那样搜索.
第一次在机器上使用Mercurial.
添加新的repoz:
c:\bla\>hg add
Run Code Online (Sandbox Code Playgroud)
没问题.
接下来,提交:
c:\bla\hg commit
Run Code Online (Sandbox Code Playgroud)
错误:
abort:没有提供用户名(参见"hg help config")
Kev*_*Won 94
解:
在我的Windows安装上,Mercurial.ini没有传播.它还需要添加用户电子邮件.
获取Mercurial.iniMercurial可执行文件安装目录(C:\Program Files\Mercurial\Mercurial.ini在我的机器上)中找到的默认文件,并将其复制到用户主目录(C:\Documents and Settings\myName在winXP上).
在Windows 7安装中没有默认的.ini,您需要在其中创建一个新的.ini C:\Users\myName.
然后编辑该.ini文件.找到这个区域.用户名需要一个电子邮件集.它将为空白 - 在此处添加您的电子邮件名称.
[ui]
; editor used to enter commit logs, etc. Most text editors will work.
editor = notepad
username = userEmail@domain.com
Run Code Online (Sandbox Code Playgroud)
这解决了我的问题.
Mar*_*ler 51
对不起,你为什么称这个为问题?Mercurial要求您查看hg help config,此帮助文本明确告诉您如何添加用户名 - 我知道,因为我写了帮助文本:-)
我们应该如何改进错误信息以使其更清晰?
编辑:自从我在2010年写这篇文章以来,我们已经设法通过hg help config为所有配置设置提供包含帮助来解决这个问题.所以如何设置用户名的好例子:
[ui]
username = Your Name <your@email.com>
Run Code Online (Sandbox Code Playgroud)
现在已经在噪音中丢失了(添加它~/.hgrc,如有必要,创建文件).我为此打开了一个问题.
Zam*_*oni 13
在Windows XP上,我没有看到ini文件.使用该命令创建存储库后hg init,我hgrc在文件夹中添加了一个带有名称的文件.hg
具有以下内容:
[ui]
editor = notepad
username = zamboni@icemachine.com
Run Code Online (Sandbox Code Playgroud)
小智 9
无论是windows还是linux,hg都会查看"/.hg/hgrc"文件以获取有效配置.正如在"hg help config"中所说,您只需在该文件的末尾添加以下行:
[ui]
username = YOUR NAME <EMAIL@HOST.COM>
verbose = true
Run Code Online (Sandbox Code Playgroud)
保存和"hg commit -m'test'"