Mercurial error: abort no username supplied

后端 未结 10 1326
生来不讨喜
生来不讨喜 2021-01-30 01:01

Problem on WindowsXP (likely will happen on all Win installs), first time using Mercurial. I found the answer in an inobvious place so I\'m asking/answering the question myself

相关标签:
10条回答
  • 2021-01-30 01:59

    This is a problem because in the help file the path to the specified config file does not exist, we have to copy the Mercurial.ini from program files directory to USER directory, maybe this is a problem coming from the installer on windows.

    @Kevin Won: you forgot to add the line:

    verbose = True
    
    0 讨论(0)
  • 2021-01-30 02:03

    no matter windows or linux, hg looks the "/.hg/hgrc" file for valid configuration. As in "hg help config" says, you only have to add at the end of that file the following lines:

    [ui]
    username = YOUR NAME <EMAIL@HOST.COM>
    verbose = true
    

    save and "hg commit -m 'test'"

    0 讨论(0)
  • 2021-01-30 02:03

    Configure you .hgrc like this:

    [ui]
    username = your name <youremail@host.com>
    verbose = True
    

    NOTE!! Do not leave out the [ui] part

    0 讨论(0)
  • 2021-01-30 02:04

    Solution:

    On my Windows install, the Mercurial.ini did not get propagated. It also needs a user email added to it.

    Take the default Mercurial.ini file found at in the Mercurial executable install directory (C:\Program Files\Mercurial\Mercurial.ini on my machine) and copy it to your user home dir (C:\Documents and Settings\myName on winXP).

    On a Windows 7 install there is no default .ini, you will need to create a new one in C:\Users\myName.

    Then edit that .ini file. Find this area. The username needs an email set. It will be blank--add your email name here.

    [ui]
    ; editor used to enter commit logs, etc.  Most text editors will work.
    editor = notepad
    username = userEmail@domain.com
    

    This fixed the problem for me.

    0 讨论(0)
提交回复
热议问题