问题描述:

Everytime I do a commit, I get ....

abort: default repository not configured! hint: see the path section

in the "hg help config"

[Code 255]

.. so I type hg help config and it apparently doesn't really have a "path" section. It does have a file section which talks about config files, saying...

On Windows, the following files are consulted:

- "<repo>/.hg/hgrc" (per-repository)

- "%USERPROFILE%\.hgrc" (per-user)

- "%USERPROFILE%\Mercurial.ini" (per-user)

- "%HOME%\.hgrc" (per-user)

- "%HOME%\Mercurial.ini" (per-user)

- "<install-dir>\Mercurial.ini" (per-installation)

- "<install-dir>\hgrc.d\*.rc" (per-installation)

- "HKEY_LOCAL_MACHINE\SOFTWARE\Mercurial" (per-installation)

- "<internal>/default.d/*.rc" (defaults)

...So I look in my /.hg/hgrc file, and I see:

[paths] default = M:\Workspaces\AziGamma which is my parent folder path.

I'm still not clear how I'm supposed to address this error. Any suggestions are welcome.

网友答案:

As hg help config says:

"default"

Directory or URL to use when pulling if no source is specified. Default is set to repository from which the current repository was cloned.

That means you should have original repository in M:\Workspaces\AziGamma and it is not there, hence the error you receive.

How to solve the error:

  1. If you have cloned repository from M:\Workspaces\AziGamma then make sure that original master repository is still in that path. If you have moved it, replace path in hgrc file with new location.

  2. If you haven't cloned your repository and you don't have any original master repository (or you cloned but you don't need it anymore) - which means that you are not going to push/pull - then just delete line default = M:\Workspaces\AziGamma from your hgrc file

相关阅读:
Top