Search code examples
mercurialvisualhg

Locked .csproj file breaking Mercurial respository


I am using VisualHG inside Visual Studio. On occasion when pulling (with Fetch) I get this error message:

[Errno 13] C:\inetpub\Websites\SomeProject.csproj: The process cannot access the file because it is being used by another process

This in turn makes a mess of my repository causing me to have to delete everything and pull again. Is there anything I can do to prevent this? It seems this issue never happens when pulling from TortoiseHG or from the command line, only when the project is opened in Visual Studio and pulling with VisualHG.


Solution

  • We're seeing something very similar on a machine here with TortoiseHg 2.0.4 and VS2008. It looks like Visual Studio it briefly locking the file as it detects a file modification event, and this is causing Hg to fail. We're seeing this with both TortoiseHg and the command-line client.

    Whilst it's pretty frustrating when it happens during a pull, it also happens during a merge too, which can be pretty catastrophic.