Search code examples
vb.netmercurial

How to move module under Mercurial to another VB.NET project?


Am using a single Mercurial repository to track my VB.NET 2010 solution myVBsolution. This contains 2 projects projectA & projectB. My module 'module1' is in projectA. The top of my mercurial repository is myVBsolution.

How do I move it to projectB in VB.NET. retaining change history for module1?

I have read that I need you need to use hg mv to perform the copy, but do not know the steps required to integrate the move with VB.NET.

The structure of code now:

myVBsolution
  projectA  
    -module1  
  projectB

Wanted:

myVBsolution
  projectA
  projectB
    -module1


Solution

  • You can move the file using hg mv outside of Visual Studio. After that, in Visual Studio, remove the now missing file from projectA and use Add->Existing Item on projectB to add it to projectB.


    But if you use TortoiseHg, it's even easier: Just move the file in Visual Studio and use the Detect Renames function of TortoiseHg (you can use 100% similarity).