How can I tell SVN that the file has been renamed by another tool?

I use Subversion with some files that are managed by another application. I would like to rename the files, but the renaming must be done from the application so that it correctly updates its own metadata. This means that I can’t just use the SVN rename command - application metadata will become inconsistent.

So, how can I tell SVN that the files in the working copy have been renamed to this application, so that it saves the history in the same way as in the rename command?

+4
source share
4 answers

You could simulate a “record only” rename after a fact with something like

 rename newname oldname svn rename oldname newname 

This will save any changes your application can make inside the file, but allows svn to establish a connection between the history of "oldname" and "newname".

+1
source

You do not specify your environment, but if you are on Windows, then TortoiseSVN provides a little-known and rather elegant solution for this. Suppose you have a SuiteSetup.cs file that you renamed SuiteSetup-Rev2.cs in your application.

In the Commit or Check Changes dialog box > in the TortoiseSVN context menu, select the old name (showing the missing status) and the new name (showing non-versioned ), then open the context menu and select Restore move (link: Restore rename files ). As shown in the figure, TortoiseSVN performs all accounting adjustments to convert them to the associated delete-add pair, as the renaming or relocation should look like.

[Adapted from TortoiseSVN and Subversion Cookbook, Part 2 , published on Simple-Talk.com. At the time of writing, Part 8 will be published.]

repairing a file move

+7
source

I do not think you can do this with the current SVN. The reason for the svn rename command is actually because you have to tell svn what renaming is so that it can prepare the corresponding metadata.

If svn doesn’t change its design to “guess” your renames (for example, git) or provide a write-only rename command that only updates the metadata (you still need to figure out what your application is really renaming and issue the appropriate commands). However, none of these features is available, and it is unlikely to happen either at least in the near future.

0
source

As I know, SVN cli does not have this function, but SmartSVN does (you select 2 files and press Move).

0
source

Source: https://habr.com/ru/post/1432842/


All Articles