[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: "svn copy --parents" allows insertion of an errant '\' in http://path

From: Ryan Schmidt <subversion-2014_at_ryandesign.com>
Date: Wed, 7 May 2014 14:47:17 -0500

On May 6, 2014, at 18:25, Dan Ellis wrote:

> I pulled a silly mistake just now... I accidentally let my windows backslash enter into an http URL during an SVN copy operation.
>
> copy --parents "C:\Project_files\sandbox\bar.c" "http://svr/sandbox/A\B/bar1.c" -m "bad commit"
>
> It successfully committed.
>
> svn update now returns the following:
>
> svn: E155000: 'A\B' is not a valid filename in directory 'C:\Project_files\sandbox\'
>
> First, I assume there should be a check to prevent this invalid character for URLs.

You could create a pre-commit hook to check for the many Windows filename restrictions. I presume Subversion does not itself contain code to do so because this and other filenames that are invalid on Windows are valid on non-Windows operating systems.

> Second, how do I undo my error?

You could remove the problem item and try again:

svn rm "http://svr/sandbox/A\B/bar1.c" -m "remove bad commit"
svn copy --parents "C:\Project_files\sandbox\bar.c" "http://svr/sandbox/A/B/bar1.c" -m "good commit"

Or you could try moving the bad item to the correct path:

svn mv "http://svr/sandbox/A\B/bar1.c" "http://svr/sandbox/A/B/bar1.c" -m "fix bad commit"

You may need to first create the destination directories if they don't already exist in the repository.
Received on 2014-05-15 18:35:18 CEST

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.