You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Graham Leggett <mi...@sharp.fm> on 2007/05/15 10:14:06 UTC

svn client and long filenames on Windows

Hi all,

I have a set of developers who have a habit of checking in extremely long
filenames in subversion repositories on a Windows platform. They do this
using TortoiseSVN, which works, but when an attempt is made to check out
the code as part of a maven build, the error below is thrown.

At the core of the problem is the Windows limit of 256 character paths. I
suspect TortoiseSVN works around the problem by changing to each directory
before accessing a file, however the subversion client seems to want to
access files in one go relative from the current directory, which then
breaks with "path too long".

Is this something easy to fix in the subversion client?

The error is:

[INFO]
------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO] Unable to checkout from SCM
Provider message:
The svn command failed.
Command output:
svn: Your .svn/tmp directory may be missing or corrupt; run 'svn cleanup'
and try again
svn: Can't open file
'checkout\alchemy-quant\src\matlabdevelopment\Toolbox\Excel
Addins\SCMBExcelTools\Miscellaneous\Installation
Docs\.svn\tmp\text-base\INSTALLATION INSTRUCTION FOR SCMBExcelTools for
Excel 2000 (Hong Kong Version).doc.svn-base': The system cannot find the
path specified.

Regards,
Graham
--


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn client and long filenames on Windows

Posted by Patrick Mayweg <ma...@qint.de>.
Hi Dan,
the use of relative paths in Java is not a good idea anyway.
Please see the discussion on this bug on top 25 bugs:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4117557
Patrick

Daniel Rall wrote:
> On Tue, 15 May 2007, C. Michael Pilato wrote:
>
>   
>> See "Naming a File" <http://msdn2.microsoft.com/en-us/library/aa365247.aspx>
>> for the gory details.   (Peter was more correct -- you get 32k bytes for
>> absolute UNC paths.)
>>     
>
> Graham, we ought to be able to fix this in Maven by explicitly
> specifying all local paths using java.io.File.getAbsolutePath().
>
> - Dan
>   

-- 
Qint Software GmbH
Fichtenstr. 19
82110 Germering
+49 89 89026748
Sitz: München HRB 117326
Geschäftsführer: Hans Marggraff, Patrick Mayweg

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn client and long filenames on Windows

Posted by Daniel Rall <dl...@collab.net>.
On Tue, 15 May 2007, C. Michael Pilato wrote:

> See "Naming a File" <http://msdn2.microsoft.com/en-us/library/aa365247.aspx>
> for the gory details.   (Peter was more correct -- you get 32k bytes for
> absolute UNC paths.)

Graham, we ought to be able to fix this in Maven by explicitly
specifying all local paths using java.io.File.getAbsolutePath().

- Dan

Re: svn client and long filenames on Windows

Posted by "C. Michael Pilato" <cm...@collab.net>.
See "Naming a File" <http://msdn2.microsoft.com/en-us/library/aa365247.aspx>
for the gory details.   (Peter was more correct -- you get 32k bytes for
absolute UNC paths.)


C. Michael Pilato wrote:
> Graham Leggett wrote:
>> On Tue, May 15, 2007 3:05 pm, Peter Lundblad wrote:
>>
>>> Is it possible to turn your tool into submitting absolute paths to svn?
>> The tool is Apache Maven http://maven.apache.org, so getting it changed
>> will involve convincing the maven people to do it.
>>
>> Can you give an example of what you mean by submitting absolute paths?
>>
>> My understanding is that no path in Windows can exceed 256 characters in
>> length, so an absolute path will (in theory) not work either. In am also
>> not a Windows person, so I cannot be sure on this either.
> 
> The limitation of 250-some characters is true for relative paths (that is,
> paths whose target determination is dependent upon the location from which
> the path is evaluated:
> 
>     "foo.c"
>     "..\bar\foo.c"
> 
> These are relative paths because if I'm at a CMD shell and I type "notepad
> foo.c" then NOTEPAD.EXE is going to assume I mean the "foo.c" sitting in my
> current working directory.  If I change to a different working directory and
> type "notepad foo.c", NOTEPAD.EXE will look in *that* directory for a file
> called foo.c.
> 
> Windows, however, allows you something like 65k bytes if you use UNC
> notation and an absolute path, which APR does (on most systems) for you.  An
> absolute path is one that, for a given drive letter, is unambiguous.  I can
> be "in" any directory on the C: drive and type "notepad C:\bar\foo.c" and
> get the same foo.c loaded into NOTEPAD.EXE every time.
> 
> So, the recommendation here is that in your build scripts, don't do
> something like:
> 
>    svn checkout http://myserver.com/repos/trunk working-copy
> 
> because "working-copy" is relative to your current working directory.
> 
> Instead, do:
> 
>    svn checkout http://myserver.com/repos/trunk C:\Projects\working-copy
> 
> because there can be no question about where C:\Projects\working-copy is --
> it's an absolute path.
> 


-- 
C. Michael Pilato <cm...@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand


Re: svn client and long filenames on Windows

Posted by "C. Michael Pilato" <cm...@collab.net>.
Graham Leggett wrote:
> On Tue, May 15, 2007 3:05 pm, Peter Lundblad wrote:
> 
>> Is it possible to turn your tool into submitting absolute paths to svn?
> 
> The tool is Apache Maven http://maven.apache.org, so getting it changed
> will involve convincing the maven people to do it.
> 
> Can you give an example of what you mean by submitting absolute paths?
> 
> My understanding is that no path in Windows can exceed 256 characters in
> length, so an absolute path will (in theory) not work either. In am also
> not a Windows person, so I cannot be sure on this either.

The limitation of 250-some characters is true for relative paths (that is,
paths whose target determination is dependent upon the location from which
the path is evaluated:

    "foo.c"
    "..\bar\foo.c"

These are relative paths because if I'm at a CMD shell and I type "notepad
foo.c" then NOTEPAD.EXE is going to assume I mean the "foo.c" sitting in my
current working directory.  If I change to a different working directory and
type "notepad foo.c", NOTEPAD.EXE will look in *that* directory for a file
called foo.c.

Windows, however, allows you something like 65k bytes if you use UNC
notation and an absolute path, which APR does (on most systems) for you.  An
absolute path is one that, for a given drive letter, is unambiguous.  I can
be "in" any directory on the C: drive and type "notepad C:\bar\foo.c" and
get the same foo.c loaded into NOTEPAD.EXE every time.

So, the recommendation here is that in your build scripts, don't do
something like:

   svn checkout http://myserver.com/repos/trunk working-copy

because "working-copy" is relative to your current working directory.

Instead, do:

   svn checkout http://myserver.com/repos/trunk C:\Projects\working-copy

because there can be no question about where C:\Projects\working-copy is --
it's an absolute path.

-- 
C. Michael Pilato <cm...@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand


Re: svn client and long filenames on Windows

Posted by Peter Lundblad <pl...@google.com>.
Graham Leggett writes:
> On Tue, May 15, 2007 3:05 pm, Peter Lundblad wrote:
> 
> > Is it possible to turn your tool into submitting absolute paths to svn?
> 
> The tool is Apache Maven http://maven.apache.org, so getting it changed
> will involve convincing the maven people to do it.
> 
> Can you give an example of what you mean by submitting absolute paths?
> 
c:\projects\interestingproject
instead of
just being in the correct directory and giving interestingproject.

> My understanding is that no path in Windows can exceed 256 characters in
> length, so an absolute path will (in theory) not work either. In am also
> not a Windows person, so I cannot be sure on this either.
> 
Path starting in "\\?\" (if I remember the syntax correctly) get parsed by
another parser and can be something like 32 kB in length.  Somewhere (I think it
is in APR), absolute paths get this string prepended, but it can't do that
for performance reasons.  I think you should try some svn commands 
with relative and absolute paths and see if this makes a difference.

I think it is clear that this is a known "defect" in svn/apr (or at least
an understood tradeoff), the rest of this discussion could move to users@.

Thanks,
//Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn client and long filenames on Windows

Posted by Graham Leggett <mi...@sharp.fm>.
On Tue, May 15, 2007 3:05 pm, Peter Lundblad wrote:

> Is it possible to turn your tool into submitting absolute paths to svn?

The tool is Apache Maven http://maven.apache.org, so getting it changed
will involve convincing the maven people to do it.

Can you give an example of what you mean by submitting absolute paths?

My understanding is that no path in Windows can exceed 256 characters in
length, so an absolute path will (in theory) not work either. In am also
not a Windows person, so I cannot be sure on this either.

Regards,
Graham
--


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn client and long filenames on Windows

Posted by Peter Lundblad <pl...@google.com>.
Graham Leggett writes:
> On Tue, May 15, 2007 1:59 pm, Talden wrote:
> 
> > Can they check out a smaller subtree of the repository content?
> 
> Unfortunately no - the checkout is done via maven, and maven chooses for
> svn the directory level at which the code is checked out, it's not under
> human control at all.
> 
Hi,

Is it possible to turn your tool into submitting absolute paths to svn?
I think the reason this works in tsvn is that it gives absoloute paths to the
svn libs which can be much longer.  svn doesn't do this itself because
we want to give the path users specify on the command line in messages.
(Note that I haven't access to a win box myself, so I'm talking out of memory
only).

Thanks,
//Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn client and long filenames on Windows

Posted by Graham Leggett <mi...@sharp.fm>.
On Tue, May 15, 2007 1:59 pm, Talden wrote:

> Can they check out a smaller subtree of the repository content?

Unfortunately no - the checkout is done via maven, and maven chooses for
svn the directory level at which the code is checked out, it's not under
human control at all.

Our campaign of getting people to not use extremely long filenames has
turned out to be a dismal failure as well, if the bug occurs on a box
other than theirs (as in this case), the developers don't care - so
modifying developer behaviour hasn't been practical either.

Regards,
Graham
--


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn client and long filenames on Windows

Posted by Talden <ta...@gmail.com>.
Can they check out a smaller subtree of the repository content?

EG
Instead of

svn co svn://supersecretserver

do

svn co svn://supersecretserver/nationalsecrets/invasionplans/countriestoinvade/bushtop10
bushtop10

This way the working copy paths don't repeat all of the repository path.

Also remember that inside bushtop10 is the svn folder with the
pristine copies and book-keeping so the actual pathlength requirement
can be longer than the repository content.

--
Talden

On 5/15/07, Graham Leggett <mi...@sharp.fm> wrote:
> Hi all,
>
> I have a set of developers who have a habit of checking in extremely long
> filenames in subversion repositories on a Windows platform. They do this
> using TortoiseSVN, which works, but when an attempt is made to check out
> the code as part of a maven build, the error below is thrown.
>
> At the core of the problem is the Windows limit of 256 character paths. I
> suspect TortoiseSVN works around the problem by changing to each directory
> before accessing a file, however the subversion client seems to want to
> access files in one go relative from the current directory, which then
> breaks with "path too long".
>
> Is this something easy to fix in the subversion client?
>
> The error is:
>
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] BUILD FAILURE
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Unable to checkout from SCM
> Provider message:
> The svn command failed.
> Command output:
> svn: Your .svn/tmp directory may be missing or corrupt; run 'svn cleanup'
> and try again
> svn: Can't open file
> 'checkout\alchemy-quant\src\matlabdevelopment\Toolbox\Excel
> Addins\SCMBExcelTools\Miscellaneous\Installation
> Docs\.svn\tmp\text-base\INSTALLATION INSTRUCTION FOR SCMBExcelTools for
> Excel 2000 (Hong Kong Version).doc.svn-base': The system cannot find the
> path specified.
>
> Regards,
> Graham
> --
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org