Mercurial hg configuration file location on Windows 7

So you’ve just installed Mercurial on Windows. You want to do an SVN import into a new Mercurial repository, so you’re looking to switch on the hg convert extension. You might be looking through this documentation looking for the correct configuration file.

Let me save you some time!

I found the correct file was under the Mercurial / TortoiseHg install:

C:\Program Files\TortoiseHg\hgrc.d

Look for the block called [extensions] and remove the semi-colon on from the the convert extension. So the file should look like so:

[extensions]
; extensions shipped with Mercurial by default
;
;acl =
;bugzilla =
;children =
;churn =
; Warning: the color extension is not recommended for Windows
;color =
convert =
;extdiff =
;eol =

Then run hg convert and you’re away.

Advertisements
This entry was posted in Uncategorized and tagged , , . Bookmark the permalink.

2 Responses to Mercurial hg configuration file location on Windows 7

  1. Hi, The file in the C:\Program Files\TortoiseHg\hgrc.d is Mercurial.rc. This is a “resource” file shipped with Mercurial and is updated/overwritten whenever Mercurial is updated so any changes to this are lost.
    The file to change is: Mercurial.ini
    which resides in your user folder: C:\Documents and Settings\\ (in Win XP and earlier) or C:\Users\\ in Vista and later.
    You could just copy and paste the [extensions] section from the Mercurial.rc file and uncomment those you want to use.
    This worked for me. After making the change to my user Mercurial.ini, the “hg convert” command worked.
    Also worth checking this out: http://stackoverflow.com/questions/1745000/can-i-clone-part-of-a-mercurial-repository
    (there’s a useful batch file at the end which could be adapted as needed).

    BTW: I really like the dog photos! We have two long haired lurcher crosses !

  2. ciaranarcher says:

    Thanks for those tips James. I have yet to use Mercurial in anger in work yet – still using SVN but if we take that step, I’ll try your suggestion.

    Yep, we’re a dog-friendly house here: 2 Yorkies! That pic was taken in Croatia on the beach last summer after a long, long drive from Ireland 🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s