Help with invalid filename stored in svn database

47 views
Skip to first unread message

Fiddler

unread,
Aug 16, 2022, 11:44:47 AMAug 16
to TortoiseSVN

I just ran across an older repository in my SVN database that has a couple of files that have an invalid filename.  The filename as seen within TortoiseSVN as well as viewing through a browser is '/'.  If I click on the file while using the broswer, it opens up and I can see the ascii text within and it actually c code.
If I try to rename using TortoiseSVN I get the following error: "Subversion reported an error: File not found: transaction 'xxxx-xx', path 'trunk/directory/subdir1/subdir1a/file' (where file is the filename I want to change to).
If I try to check out using the windows command prompt I get the following once the bad filename is encountered:
"svn: E155000: Path 'C:\local-repo\repo-name\trunk\directory\sub-dir1\sub-dir1a\\' is not in the working copy".  Note the double '/' at the end with the final '/' being the filename encountered within the svn database.

How can I correct this issue without causing harm to this or any other repo within the database?  I was afraid to try to delete the file for fear of doing irreparable harm (due to the nature of '/' and what it represents on the Linux host).

Any ideas are greatly appreciated.

Niemann, Hartmut

unread,
Aug 16, 2022, 11:57:04 AMAug 16
to TortoiseSVN on behalf of Fiddler

Have you tried renaming it in the repo browser? This works without creating a file, so windows file name restrictions should not be a problem.

 

Hartmut

--
You received this message because you are subscribed to the Google Groups "TortoiseSVN" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tortoisesvn...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tortoisesvn/fa53a1f8-c6ce-4bd6-bb0f-9f6e3d3e5acan%40googlegroups.com.

Fiddler

unread,
Aug 16, 2022, 1:06:09 PMAug 16
to TortoiseSVN
Hartmut,
I was using the Tortoise Repo browser to try to rename it.  I'm unable to get it to my local machine, so the only way I currently have to try to manipulate is through the repo browser, unless there is another way that I'm not aware of.  I think the whole issue is that having a filename that's symbolically equivalent to a root directory is the issue.  I'm just not sure have to correct.

Fiddler

unread,
Aug 16, 2022, 3:36:21 PMAug 16
to TortoiseSVN
I just took a closer look at what is displayed from the web browser and the repo browser.  The file in question is actually a '\'.  It displays as a '/' when trying to check out from the command line.

If this is posted in the wrong group and needs to be in another group please let me know.

Thanks

Daniel Sahlberg

unread,
Aug 17, 2022, 3:31:04 AMAug 17
to TortoiseSVN
tisdag 16 augusti 2022 kl. 21:36:21 UTC+2 skrev Fiddler:
I just took a closer look at what is displayed from the web browser and the repo browser.  The file in question is actually a '\'.  It displays as a '/' when trying to check out from the command line.

Good find! There are, unfortunately, a few characters that can't be part of valid filenames in Windows while still allowed in Subversion. I don't know an exhaustive list by heart but '\' and ':' are two examples.

The error displayed by the Repository Browser sure seems like a problem in TortoiseSVN. I don't have the time to dig around at the moment though.

I reproduced your issue and saw the same errors. I was able rename the file using the svnmucc command line client (if you don't already have it you can install it in the TortoiseSVN installer):


The URLs are copied from the Repository Browser and the filename (here just \) added. The new filename is in the end of the second URL (here "backslash") is whatever you would like the new file to be called. -m is the commit message.

Kind regards,
Daniel

Bruce C

unread,
Aug 17, 2022, 4:30:37 AMAug 17
to TortoiseSVN
Hi,

I wasn't aware of the svnmucc command, so that's something new to learn. Thanks.

An alternative solution, with the same approach, is to use the svn move command. The command that worked for me was as follows:

svn move -m "Rename file to filename that is valid on Windows"  https://server.example.com/svn/repo/path/\ https://server.example.com/svn/repo/path/newname.txt

Hope this helps.

Fiddler

unread,
Aug 17, 2022, 7:43:50 AMAug 17
to TortoiseSVN
Thank you Daniel!
That did the trick nicely.

Very much appreciated.

Chris

Fiddler

unread,
Aug 17, 2022, 7:52:39 AMAug 17
to TortoiseSVN
Bruce, Thanks for the information.  Now i have two avenues to correct in the future if I run across this again.  I thought I had tried that command before posting this, but apparently I was doing something wrong.

Phil Seakins

unread,
Aug 17, 2022, 10:07:21 PMAug 17
to TortoiseSVN
After backing up the repository I would examine it with low level tools and once I found the slash I would change it to an X or a Y using a hexeditor such as Hxd. Might not work and there might be too many slashes to narrow it down but that would probably be my first angle of attack. Obviously Daniel's solution is much safer.

Daniel Sahlberg

unread,
Aug 18, 2022, 4:56:19 AMAug 18
to TortoiseSVN
torsdag 18 augusti 2022 kl. 04:07:21 UTC+2 skrev Phil Seakins:
After backing up the repository I would examine it with low level tools and once I found the slash I would change it to an X or a Y using a hexeditor such as Hxd. Might not work and there might be too many slashes to narrow it down but that would probably be my first angle of attack. Obviously Daniel's solution is much safer.

I would really advice against editing the repository files manually. While the files look human-readable, they are actually a very tightly defined binary format. In particular, there may be references between different files that are not obvious. Even if the repository is successfully updated it might break existing working copies having the particular file checked out. (That last argument is one of the reasons why it is difficult to purge revisions from an SVN repository).

Editing the repository files MIGHT be a last resort if there is really low level data corruption and there is no other way to restore the data.

Kind regards,
Daniel

Phil Seakins

unread,
Aug 19, 2022, 6:32:33 PMAug 19
to TortoiseSVN
Agreed. It was dumb of me to even suggest it. The repo structure is way too convoluted to attempt such a thing.
Reply all
Reply to author
Forward
0 new messages