Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

svn command line utility will not work if full file name is longer then 256 characters

Tags:

svn

I cannot create working copy from command line using svn utility if resulting full file names for some files are too long.
But I can successfully create working copy from TortoiseSVN or from Subclipse.
Why?

like image 702
Volodymyr Bezuglyy Avatar asked Dec 07 '09 09:12

Volodymyr Bezuglyy


3 Answers

Instead of doing the following in your current directory:

svn co http://xxx/repo1

Give it the full target path like this:

svn co http://xxx/repo1 E:\abc\pqr\xyz\abc\pqr\xyz\repo1
like image 163
Stop Putin Stop War Avatar answered Oct 11 '22 18:10

Stop Putin Stop War


This isn't really a limitation of the svn client but of the windows console: relative paths can't exceed MAX_PATH (254) chars when expanded.

And unlike some commenter here claims, it is not an oversight of the svn developers to forget about MAX_PATH. Because: if you pass full paths instead of relative ones, the commands will work.

So, instead of

cd C:\some\...\very\long\path
svn up .

run

svn up c:\some\...\very\long\path

and it should work just fine.

like image 37
Stefan Avatar answered Oct 11 '22 20:10

Stefan


As a workaround, you can subst your working copy to a drive letter to keep down the path length:

C:\Users\Me\SVN\My\Cool\Repository\With\A\Very\Long\Path> subst S: .
C:\Users\Me\SVN\My\Cool\Repository\With\A\Very\Long\Path> S:
S:> svn up
like image 36
Joey Avatar answered Oct 11 '22 18:10

Joey