8

I am trying to check out a full subversion repository including all branches and tags:

svn co svn+ssh://path/to/project

This runs for a while, but during the checkout of a branch I get the following error:

svn: Your .svn/tmp directory may be missing or corrupt; run 'svn cleanup' and try again
svn: Can't open file 'project\branches\BRANCH\source\java\com\bS\.svn\tmp\text-base\Event.java.svn-base': The system cannot find the path specified.

So I tried to checkout the branch manually by doing:

svn co svn+ssh://path/to/project/branches/BRANCH

This runs fines and I get the branch. I can then copy the branch into the branches directory of the full project and continue with the checkout. But it keeps running into this problem on other branches.

Does anyone have any idea why I can't checkout the branch as part of the overall project, but I can check it out on its own?

Zoe
  • 27,060
  • 21
  • 118
  • 148
DaveJohnston
  • 10,031
  • 10
  • 54
  • 83
  • Did you try running svn cleanup? – Michael Kopinsky Jan 17 '11 at 14:12
  • remark which is probably unrelated to the error: unless you know what you are doing (i.e. you know how to create shallow checkouts), you should not check out the top level of a project with all the branches and tags included. If the project has a thousand tags, then your checkout will contain a thousand copies of the project. Check out the trunk or a specific branch instead. – Wim Coenen Jan 17 '11 at 15:06
  • @Wim Coenen thanks. I just wanted to create a local copy of the SVN repo so that I could try a conversion to Mercurial without the risk of damaging any data. I have now changed tactic and created my local copy by creating a dump from the main server and loading it into a newly created local repo. – DaveJohnston Jan 17 '11 at 16:56

4 Answers4

7

You can work around this problem on Windows by specifying the fully qualified path in the parameter to the svn command. For example rather than

c:\dev> svn co http://repoman.example/svn/myproj/trunk myproj

try this

c:\dev> svn co http://repoman.example/svn/myproj/trunk c:\dev\myproj

For some reason path length limits only apply to relative paths.

JayTonton
  • 3
  • 3
Victor
  • 3,395
  • 1
  • 23
  • 26
  • 1
    This worked for me. Good thing because I was already at the root of the drive, there was no way to shorten the checkout path. –  Jan 15 '13 at 03:11
6

Ok, so I have actually found the answer to my own question, well at least the solution. It turns out that it is to do with the length of the path. In my question above I edited the path name to not post details of company's code, but in reality it happened to be a file with a very long name and it lived in quite a deeply nested directory.

When I was checking out the branch on its own I was checking it out into a higher level directory in my hard drive and it was working. I tried checking out the branch on its own directly into the branches directory I had created for the project and it also failed, so I guess it must have had something to do with the path.

I am now checking out the entire project into D:\ProjectDir and everything seems to be going a lot more smoothly. I guess there is a limit in subversion to the length of a path and so it was failing to get some of the required files.

*Update: the limit is 255 characters. It turned out that in my case the path was 269 characters. So just going up 1 directory level was enough to get around the problem.

DaveJohnston
  • 10,031
  • 10
  • 54
  • 83
  • 2
    You're on Windows. Right? The maximum path length is a big Windows issue. I've seen spamware hidden using this. Windows Explorer and anti-malware couldn't see the files, but they were there. The irony is that Windows CAN handle these long paths, and NTFS CAN handle these paths. However, Windows Explorer and the basic file open/close libraries cannot. You can do programming technics using // paths that will allow you to get around these issues, but no one uses them. Why MS still has this faux limit in Windows is anyone's guess. Especially since .NET uses long path names. – David W. Mar 09 '11 at 21:27
  • It's not very useful by that workaround, since sometimes you don't have that luxury to "go up one level". I would recommend Victor's solution(posted later) instead: using absolute path in your checkout link, not relative path – Hoàng Long Nov 12 '14 at 10:16
2

Check this: find . -iname '.svn' -exec mkdir {}/tmp \;

EpokK
  • 38,062
  • 9
  • 61
  • 69
0

You also get this error when checking out filenames that are prefixed with the special Windows device names such as CON and PRN (e.g. CON.java):

http://mail-archives.apache.org/mod_mbox/subversion-users/201209.mbox/%3C4C6D8718-51F0-4DC7-9E74-E8161EC686AC@ryandesign.com%3E

Arno Bakker
  • 329
  • 1
  • 4