开发者

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

I cannot create working copy from c开发者_如何学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?


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.


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


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


If your command line is in fact the Cygwin bash, then you could have hit this bug:

http://www.itefix.no/i2/node/11064 or http://old.nabble.com/file-name-too-long-td22189828.html

which in fact is, that Cygwin can't handle paths with lengths over 255 chars. (In addition to Stefan's answer: Neither absolute nor relative paths are possible here.) Cygwin 1.7, which is beta since half a year, seems to fix this.


I had the same problem on a Ubuntu system when trying to checkout a repository with very long filenames. However, I found out that my problem was related to the encryption of my home drive, as explained here: http://ubuntuforums.org/showthread.php?t=2258374

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜