3

Scenario in VS2012, with VisualSVN.

  • Right-click rename a file (using VS solution explorer)
  • Hack for several hours
  • Right-click commit project
  • Right-click and repair the before/after versions of the file
  • An 'error' box says "file can't be found"
  • And yes, quite right, the NEW version of my file is gone.
  • (Expletives deleted)

I know that SVN doesn't like not being the master of rename, but what's going wrong here?

enter image description here

Community
  • 1
  • 1
Benjol
  • 63,995
  • 54
  • 186
  • 268
  • 1
    *Right-click and repair the before/after versions of the file* - can you give some more info about this step? – Ivan Jovović Apr 21 '15 at 14:55
  • @IvanJovovic, I pasted an image. – Benjol Apr 22 '15 at 06:30
  • I have managed to reproduce the described issue, but nothing more. The exact error message is: *The system cannot find the file specified*. – Ivan Jovović Apr 22 '15 at 07:51
  • 1
    Fixed. http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=757&dsMessageId=3114142 – bahrep Apr 22 '15 at 18:02
  • If you are using VisualStudio, shouldn't you be using the VisualStudio Integration and not TortoiseSVN? I never used VisualSVN as a VisualStudio plugin, but it should work directly in VisualStudio. I've use [AnkhSVN](https://ankhsvn.open.collab.net) as a VisualStudio integration and didn't have problems with renaming a file *inside VisualStudio*. – David W. Apr 22 '15 at 20:38

1 Answers1

1
  1. It seems to be a bug in TortoiseSVN. I've just reported it to dev@ TortoiseSVN mailing-list. The bug has been just fixed. Thanks to Stefan Kung.

  2. You don't need to run "Repair move" command on files that were properly renamed or moved. VisualSVN tracks all file operations performed in Visual Studio and reflects them to Subversion. Moves, adds, renames, etc -- these are all covered by VisualSVN plug-in.

Here is a quote from TortoiseSVN manual linked to your question:

Sometimes your friendly IDE will rename files for you as part of a refactoring exercise, and of course it doesn't tell Subversion.

VisualSVN actually tells Subversion that there was a rename, therefore you don't need to run "Repair move" when using VisualSVN.

Just try to rename a file in some testing Visual Studio solution using VisualSVN and check svn status to see what happened. For example, here is the result you'll see:

D       WindowsFormsApplication3\Program.cs
        > moved to WindowsFormsApplication3\SUPERPROGRAM.cs
A  +    WindowsFormsApplication3\SUPERPROGRAM.cs
        > moved from WindowsFormsApplication3\Program.cs

As you can see, the file has been properly renamed.

And here is the repository log entry for the rename after you commit the change:

r3 | Pavel.Lyalyakin | 2015-04-22 13:46:38 +0300 (Wed, 22 Apr 2015) | 1 line
Changed paths:
   D /trunk/WindowsFormsApplication3/Program.cs
   A /trunk/WindowsFormsApplication3/SUPERPROGRAM.cs (from /trunk/WindowsFormsApplication3/Program.cs:2)

As you can see, there is a note that the file SUPERPROGRAM.cs was renamed from Program.cs in revision 2.

bahrep
  • 29,961
  • 12
  • 103
  • 150
  • Great, good to know I'm not crazy :) As an aside, I think the (+) notation is nuts, because it just looks like it's a synonym of Add. Couldn't they put 'renamed' there instead? – Benjol Apr 23 '15 at 04:34
  • @Benjol not yet. I guess it will be improved when rename tracking will be implemented in future Subversion updates. It's on Subversion's roadmap http://subversion.apache.org/roadmap.html – bahrep Apr 23 '15 at 04:43