Wednesday, April 7, 2010

Moving Windows Forms with Subversion and TortoiseSVN

If you’re using a subversion client that doesn’t have Visual Studio integration (e.g., TortoiseSVN) then moving a Windows Form can be a pain.  Here’s one slightly-less-painful way:

  1. Right click the form in Visual Studio’s Solution Explorer and exclude it from the project.
  2. Open up Windows Explorer, browse to the directory containing the Form.cs, Form.Designer.cs and Form.Resx files.
  3. Turn on Folders in Windows Explorer.  This will cause the folder tree view to appear.
  4. Select all three files, the right-drag (yes, Windows Explorer supports dragging a selection with the right mouse button) the files to the destination folder.
  5. When you release the right mouse button choose “SVN Move”.
  6. Include the files in Visual Studio project.  I usually do this by turning on “view all files” in solution explorer then using the context menu (right-click) to include the form.

That’s it.  Not too painful when you think about it but doing it this way keeps the linkage between the new location and the old location in subversion.

No comments :

Post a Comment