Cannot Commit in Visual Studio 2008 on Windows 7 and TortoiseHg1.0

Mar 10, 2010 at 3:36 AM


What's the maximum supported version of TortoiseHg? I've installed both 0.93 and 1.0 on 64-bit Windows 7 with Visual Studio 2008. The Commit, Status and Synchronize buttons in the toolbar don't work, but the HG History does.  Same deal on the context menu in the Visual Studio explorer. 

TortoiseHg seems to work fine on it's own.

No errors or warnings are displayed so I can't give much more info.




Mar 10, 2010 at 4:04 AM

Exact same thing here.  I have Tortoise 1.0 on 64bit Windows Vista and Visual Studio 2008.

When I right click and use the context menu, no matter what I select it just does nothing.

The files in the solution do show the correct icons (for committed, changed, etc)

Mar 10, 2010 at 6:53 PM

I never checked out 64 bit windows so far, but I will catch up that the next day's. Under 32 bit windows all commands works fine - also with Tortoise v 1.0.



Mar 11, 2010 at 5:08 AM

I could take a look at the code if you had an idea where it may need a change. Any idea where to look? It could be an issue with 32 bit programs (including 64 bit TortoiseHg because it uses 32 bit components) It seems odd that HG History works.

Mar 11, 2010 at 5:53 PM
Edited Mar 11, 2010 at 6:18 PM

Hello Peter,

today I checked out Windows 7 64 Bit with TortoiseHG 1.0 installed, VC 2008 and also VC 2010 RC. And I can't see any problems so far.

To find out what happen on your machine you should inspect the following routines:

Project HGLib file HGTK.cs

      HGTK.CommitDialog(string directory)

      HGTK.UpdateDialog(string directory)


All these methods are using on her part HGTK.HGTKDialog with corresponding arguments.

To start your developments, you have to install the VC SDK 2008. Let me know if you need further help on that.

Regards, Bernd

Mar 12, 2010 at 12:13 AM

To Bernd and Wayne were you two using admin accounts? I do most of my work in an account without admin priveleges and just provide admin credentials when I need to install something.

Mar 12, 2010 at 1:07 AM

Yes, I am in an admin account.

Everything seems to work except the menu items do not do anything.

Those menu items just attempt to run the Tortoise UI, right - what commands do they issue?  Could it be some path issue or something?

Mar 12, 2010 at 5:11 PM

I'am wondering about the history dialog is comming up!? What ist about with a simple root path e.g "c:\test". That should never run into path issues.

Next question - can you start HGTK.exe from the command line?

Here is an example for a commit call

InvokeCommand("c:\\Develop\\HGTest", "commit");

static Process InvokeCommand(string workingDirectory, string arguments)
            Process process = new Process();
            process.StartInfo.UseShellExecute = false;
            process.StartInfo.CreateNoWindow = true;
            process.StartInfo.FileName = "HGTK.exe";
            process.StartInfo.Arguments = arguments;
            process.StartInfo.WorkingDirectory =  workingDirectory;
            return process;



Mar 12, 2010 at 6:37 PM

Ok, I have figured out the problem.

Previously after uninstalling HGTortoise 0.x, it asked me to reboot, which I did.

I then installed HTTortoise 1.0 and it did not ask me to reboot.

Looking at my windows PATH environment variable through 'my computer', I can see HGTortoise path there.

If I go to a cmd prompt and run HGTK, it works.

However, if running an example like the above from VS or .net program, it cannot find it.  Printing the environment variable from C# code shows the HGTortoise path is NOT present.

Rebooted machine, now everything works fine.


Here is an article on the path not updating unless you restart explorer.exe or make an API call:

Mar 21, 2010 at 8:23 PM

I had already tried restarting, and that wasn't my issue. Though, I think I just found out what caused my problem. I put all my Visual Studio projects in the folder C:\Users\Non-Admin\Documents\Visual Studio 2008\Mercurial. I then tried putting a project in C:\Develop and VisualHG worked fine. Might the problem be the space or the hyphen?

Mar 21, 2010 at 11:27 PM
Edited Mar 22, 2010 at 12:16 AM

I'm having this exact same problem today. Hopefully a reboot will resolve it. HG History works but HG Commit does nothing.

[after reboot] no difference.

[uninstall] [reboot] [install] no change. only HG History works. 

What path is needed in the environment variables? Everything works fine via Console hg and hgtk including all commands.

Any ideas what I can try to get it to work?

Mar 27, 2010 at 3:29 AM

See, my post above. What directory is your source in?

Mar 27, 2010 at 4:12 AM

Scratch that. I can properly control other repos in that directory. I think I may have accidentally edited something in the mercurial hidden folder at one point in the past, so that may be why.