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.

Reply via email to