Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I tell SVN that a file was renamed by another tool?

Tags:

rename

svn

I am using Subversion with some files that are managed by another application. I would like to rename the files, but the rename must be done from within the application so that it correctly updates its own metadata. This means that I cannot simply use SVN's rename command — the application's metadata will become inconsistent.

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

like image 975
detly Avatar asked Feb 19 '23 06:02

detly


1 Answers

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

Within either the Commit or Check for Modification dialogs on TortoiseSVN's context menu, select the old name (showing a missing status) and the new name (showing a non-versioned status) then open the context menu and select Repair move (reference: Repairing File Renames). As shown in the figure, TortoiseSVN does all the bookkeeping corrections to convert these to a linked delete-add pair, the way a rename or move should appear.

[Adapted from my TortoiseSVN and Subversion Cookbook, part 2, published on Simple-Talk.com. At the time of writing Part 8 is just about to be published.]

repairing a file move

like image 102
Michael Sorens Avatar answered Mar 09 '23 19:03

Michael Sorens