Batch rename in TortoiseSVN

686 views
Skip to first unread message

franc walter

unread,
Nov 9, 2014, 12:44:50 PM11/9/14
to us...@tortoisesvn.tigris.org
Hello

I have discovered that in my repository on my Windows 8.1 PC there are
many file and even folder names with german Umlauts (ä,ö,ü,ß,Ä,Ö,Ü).
No problem for TortoiseSVN on PC in Windows but on my MacBook with (now)
Yosemite (OS 10.10) in my SVN-App Cornerstone, all these filenames are
marked as changed (it was also previously in SCPlugin with Mac OS 10.6.8).

Now I want to cut these old pigtails and clean all Umlauts, change them
to the according vocals (ae, oe, ue, ss, Ae, Oe, Ue).

But with about 230 different files or folders this is a longway task.

Is there any way to batch rename all these Umlauts in one or only a few
tasks without need to upload all the raw files again?

I mean if I rename, than there is nearly no traffic and the repo is
still same size. But if I upload all again and delete the Umlaut files
it would be.

How?

Thanks

frank

------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=3091024

To unsubscribe from this discussion, e-mail: [users-un...@tortoisesvn.tigris.org].

Florin Viorel Petrov

unread,
Nov 9, 2014, 4:27:56 PM11/9/14
to us...@tortoisesvn.tigris.org
On 09/11/2014 6:44 PM, franc walter wrote:

> Is there any way to batch rename all these Umlauts in one or only a few
> tasks without need to upload all the raw files again?
>

I did something similar some time ago using the command line client:
- from the command line, create the list of files, like "dir *.* >
files.txt"
- duplicate the "files.txt" and replace all umlauts in the duplicate file.
- take any editor supporting "column mode" (I use Ultraedit, it's
shareware) and open "files.txt".
- using column mode, insert in all lines, at the beginning,
"svn rename "
- copy the content of the file with fixed file names into the clipboard,
- in editor, go to a column beyond the longest file name and paste fixed
names,
- in this moment every line in editor will look like:
"svn rename <file_name_with_umlauts> <file_name_without_umlauts>"
- save the editor content as batch file,
- DOUBLE-CHECK the content of the batch file,
- run the batch file.

This is how I did it once. If I remember correctly, there is a way to
rename directly within repository by using the URL of the file (use
"http://server/path/filename", not the path into the local copy; you may
have to specify a message with "-m"; be the "svn help rename" with you!

Florin

------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=3091028

Florin Viorel Petrov

unread,
Nov 9, 2014, 4:34:06 PM11/9/14
to us...@tortoisesvn.tigris.org
> - DOUBLE-CHECK the content of the batch file,

The order of files within the batch file and how you replace the umlauts
may be very important if you have umlauts within directory names.

It may be a good idea to run the rename process more than once, fixing
the directories first.

Florin

------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=3091029

franc walter

unread,
Nov 10, 2014, 9:29:55 AM11/10/14
to us...@tortoisesvn.tigris.org
> On 09/11/2014 6:44 PM, franc walter wrote:
>
> > Is there any way to batch rename all these Umlauts in one or only a few
> > tasks without need to upload all the raw files again?
> >
>
> I did something similar some time ago using the command line client:
> - from the command line, create the list of files, like "dir *.* >
> files.txt"
> - duplicate the "files.txt" and replace all umlauts in the duplicate file.
> - take any editor supporting "column mode" (I use Ultraedit, it's
> shareware) and open "files.txt"...

Oh yes! Thank you for this hint!
I have tools to do this, totalcmd and EditPadPro (can column copy&paste also).

Did it then like this:

1. in Total Commander search for: *ä* *ö* *ü* *ß* | .svn .svn\
gives me a file and dir list of all with Umlauts in the name

2. mark all folders in the list and copy the whole path (command can be found in Mark-menu)

3. in EditPadPro I use two tabs, one with the original path names and in other tab I search and replace Umlaute to their correspondent vocals (or ss for ß).

4. Add " at beginning and end (by Search Replace with Regex: ^ for beginngin and $ for end)

5. Adding many spaces to the first (orginal names with Umlauten) tab, by search $ (end of line) and replace with spaces, that I can open a column selection which is wide enough to put the second tab content in it.

6. Open a selection on the right of the first tabs lines, at least one space between the longest line and the beginning of the selection. Length of selection must be at least as long as longest line (see 5.)

7. Paste content of second tab.

8. Search for ^ (RegEx) and replace with svn rename (one space after rename).

9. Add a line break at last line and copy first tabs content.

10. Now it was not possible to run a batch file with this, I guess the encoding makes trouble, but not any problem, because I just open a dos box and paste my clipboard (first tab) into it.
Runs line after line and renames all these files.

11. Committing the renames of folders and now doing the same with all files, same way...


It took a while but would take much longer if done by hand and much more errors I guess.
So long now no more weird svn changed files in my MacBook.

Thank!

frank

------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=3091063
Reply all
Reply to author
Forward
0 new messages