Mercurial error: abort no username supplied

后端 未结 10 1325
生来不讨喜
生来不讨喜 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:41

    This problem still exists. The mercurial.ini file is ignored no matter where you put it.

    No mercurial.ini file is created during installation. I created one in the Mercurial install directory, but it had no effect. I copied it to %USERPROFILE% and then to %HOME%, but neither one works.

    Putting .hgrc in the HOME directory works.

    The documentation ("hg help config") needs to be fixed.

    0 讨论(0)
  • 2021-01-30 01:45

    On Windows XP I do not see an ini file. After creating the repository using the command hg init, I added a file with the name hgrc to the folder .hg

    With the following content:

    [ui]  
    editor = notepad  
    username = zamboni@icemachine.com
    
    0 讨论(0)
  • 2021-01-30 01:46

    Here is what worked like a charm for me on Windows XP:

    1. Go to the folder C:\Program Files\Mercurial\hgrc.d assuming you have installed Mercurial to C:\Program Files\Mercurial\.
    2. You should see a Mercurial.RC file in there.
    3. Copy the file to C:\Documents and Settings\ [USERNAME]\
    4. Rename Mercurial.RC to Mercurial.ini.
    5. Edit the [ui] section like so:

      [ui]

      ; editor used to enter commit logs, etc. Most text editors will work.

      editor = notepad

      verbose = True

      username = userEmail@domain.com

    0 讨论(0)
  • 2021-01-30 01:57

    I'm sorry, but why do you call this a problem? Mercurial asks you to see hg help config, and this help text explicitly tells you how to add a username -- I know since I wrote that help text :-)

    How should we improve the error message to make this more clear?

    Edit: Since I wrote this in 2010, we've managed to screw this up by making hg help config include help for all config settings. So the nice little example of how to set the username:

    [ui]
    username = Your Name <your@email.com>
    

    is now lost in the noise (add this to ~/.hgrc, creating the file if necessary). I've opened an issue for this.

    0 讨论(0)
  • 2021-01-30 01:57

    I had the same problem. What helped me was to put [ui] and username = firstname lastname on separate lines of the ~/.hgrc file. Putting these two things on one line did not work and led to the error.

    0 讨论(0)
  • 2021-01-30 01:58

    If you are using TortoiseHg, you can add [UI] settings easily

    1. Right clicking in any folder Explorer to access the TortoiseHg menu.

    2. From the flyout TortoiseHg menu choose Global Settings

    3. From the interface click the Edit File

    4. Add the [UI] settings to the end

    [ui]

    username = YourName

    verbose = true

    1. Save and you are done
    0 讨论(0)
提交回复
热议问题