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?
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.]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With