0

I'm hoping that this is in the right spot.

Basically, I have a set of files which are versioned in an SVN repository, and I am using TortoiseSVN. These files all need to be renamed so that their new name is equal to their current name, plus a prefix added to the front.

Tortoise has the ability to rename the files, but it must be done manually, file by file, through a GUI menu, and I would prefer a less tedious and less time-consuming solution.

I have seen on this site examples which use Windows-based solutions, but I do not expect these to work, as they would not change the filename through TortoiseSVN but through Explorer, which would cause TortoiseSVN to not recognize those files as being equivalent to the originals, even if we recognized them as such.

I saw another question, linked here: (tortoise svn mass rename files merge)

In which the asker says that the files were renamed with a windows tool and thus SVN did not recognize them, and the solution offered was to write a new script which would pick up the old name, replace it with the new name, and repeat for each entry. However, unless I'm misreading it, that solution would require going in and specifying the old and new name for every entry, which from my perspective could be just as time-consuming as doing the manual option in TortoiseSVN.

I considered another possibility in that I could use windows command line to make a copy of every file in the directory, renaming the copies to fit. Then I would SVN delete the old files and SVN add the new files. This would achieve the rename, but then the history association would be disrupted, as it was technically no longer the same file.

The problem I'm running into as I read different questions asking similar queries is that they seem to be built around specifying the start file name and the end file name for each entry. I want to do a blanket rename on every file, without needing to consider the file name before or after the execution.

As such, my investigation has brought me to ask this question: Given a set of known existing Files F, and a known, constant prefix P, can TortoiseSVN be made to automatically update every entry in F with the prefix P, but in a way that TortoiseSVN recognizes as its internal 'rename' process (rather than an exterior process which would, in its perspective, replace, rather than change, the given file), and without having to also define the resultant end name of each file in F (thus no need to specify old and new filename for every entry), so that each file can be updated without needing manual intervention for each one? Thank you for reading.

user2828965
  • 405
  • 1
  • 6
  • 17
  • Use the Tortoise SVN command line tools to do this, using a batch file and a loop. A search here can find you info on how to loop through files in a folder. – Ken White Aug 15 '17 at 15:12
  • I will look into this and see what I can come up with. – user2828965 Aug 15 '17 at 15:26
  • Right-click your project folder, choose Tortoise SVN->Help from the context menu, and navigate to *Command line interface cross reference->Tortoise SVN commands*, specifically *E.2.12 Rename*. – Ken White Aug 15 '17 at 15:30

0 Answers0