[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

AW: TortoiseSVN truncates URL shown in repo browser to 259 characters

From: Markus Schaber <m.schaber_at_3s-software.com>
Date: Tue, 7 Feb 2012 08:42:45 +0000

Hi, Stefan,

Von: Stefan Küng [mailto:tortoisesvn_at_gmail.com]
On 06.02.2012 16:48, Markus Schaber wrote:
>> [Checkout problems with long URLs]
>> However, on the command line or using SharpSVN, I can checkout
>> aforementioned URL fine.

Clarification: "aforementioned URL" is the Url I mentioned, not the one of the original poster.

But the original posters URL has no path component longer than 242 characters, AFAICS, and thus should work fine on modern windows with NTFS.

> I seriously doubt that, unless you're trying that on a non-windows OS.
> Because those clients have the same limitations that the windows API has.

Most file and directory based functions in the Win32 core API have a Unicode variant which can cope with "long pathes" using the "\\?\" and "\\?\UNC\" prefixes.[1]

Both the subversion libraries, as well as SharpSVN internally use those variants and transparently add the prefixes if needed[2]. So for both of them, the 259 characters limit [3] for the whole path is extended to about 32767 bytes if the underlying FS supports it (NTFS does). There still applies a file-system specific limit per path component (file or directory name) which is 255 for both VFat and NTFS.

And even without that, the MAX_PATH limit does not apply to URLs. So it should work fine to check out a project whose URL is longer than 259 characters, if only the directory depth inside the project (plus the working copy path) don't exceed the limit.

-- snip --
D:\test>svn --version
svn, Version 1.7.2-SlikSvn-1.7.2-X64 (SlikSvn/1.7.2) X64
   übersetzt Dec 6 2011, 13:13:15
[ ... snip ...]

D:\test>svn checkout "svn://localhost/testrepo/LongPathProject/Device/Plc Logic/Application/1_abcdefghijklmnopqrstuvwxyz/2_ABCDEFGHIJKLMNOPQRSTUVWXYZ/3_abcdefghijklmnopqrstuvwxyz/4_ABCDEFGHIJKLMNOPQRSTUVWXYZ/5_abcdefghijklmnopqrstuvwxyz/6_ABCDEFGHIJKLMNOPQRSTUVWXYZ/7_abcdefghijklmnopqrstuvwxyz/8_ABCDEFGHIJKLMNOPQRSTUVWXYZ"
A 8_ABCDEFGHIJKLMNOPQRSTUVWXYZ\9_abcdefghijklmnopqrstuvwxyz
A 8_ABCDEFGHIJKLMNOPQRSTUVWXYZ\9_abcdefghijklmnopqrstuvwxyz\svnobj
A 8_ABCDEFGHIJKLMNOPQRSTUVWXYZ\9_abcdefghijklmnopqrstuvwxyz\10_ABCDEFGHIJKLMNOPQRSTUVWXYZ\11_abcdefghijklmnopqrstuvwxyz

A 8_ABCDEFGHIJKLMNOPQRSTUVWXYZ\9_abcdefghijklmnopqrstuvwxyz\10_ABCDEFGHIJKLMNOPQRSTUVWXYZ\11_abcdefghijklmnopqrstuvwxyz\12_ABCDEFGHIJKLMNOPQRSTUVWXYZ\1_abcdefghijklmnopqrstuvwxyz\2_ABCDEFGHIJKLMNOPQRSTUVWXYZ\3_abcdefghijklmnopqrstuvwxyz\4_ABCDEFGHIJKLMNOPQRSTUVWXYZ\5_abcdefghijklmnopqrstuvwxyz\6_ABCDEFGHIJKLMNOPQRSTUVWXYZ\7_abcdefghijklmnopqrstuvwxyz\8_ABCDEFGHIJKLMNOPQRSTUVWXYZ\9_abcdefghijklmnopqrstuvwxyz\10_ABCDEFGHIJKLMNOPQRSTUVWXYZ\11_abcdefghijklmnopqrstuvwxyz\12_ABCDEFGHIJKLMNOPQRSTUVWXYZ\PLC_PRG_2\svnobj

Ausgecheckt, Revision 292.

--- snap ---

Note that in the example above, both the URL is longer than 255 characters (and the repo explorer "Url" text box truncates it after "7_abcdefghijklm"), as well as the directory hierarchy inside the working copy is deeper than 255 characters.

With SharpSVN, I successfully do the same things (actually, the whole tree below "LongPathProject\" comes from a working copy maintained by our SharpSVN based CoDeSys Subversion Plugin).

Even TortoiseSVN itself can mostly cope with those long Urls and files: The repo browser lets me navigate the repository to full depth (despite the fact that the URL is displayed truncated), and "SVN Check for modifications" on that working copy directory works fine (except that the deep pathes are displayed truncated as you mentioned).

However, it seems that the Checkout and Export operations fail with the following error message when triggered form the repo browser:

Command: Checkout from svn://localhost/testrepo/LongPathProject/Device/Plc Logic/Application/1_abcdefghijklmnopqrstuvwxyz/2_ABCDEFGHIJKLMNOPQRSTUVWXYZ/3_abcdefghijklmnopqrstuvwxyz/4_ABCDEFGHIJKLMNOPQRSTUVWXYZ/5_abcdefghijklmnopqrstuvwxyz/6_ABCDEFGHIJKLMNOPQRSTUVWXYZ
Error: URL
Error: 'svn://localhost/testrepo/LongPathProject/Device/Plc%20Logic/Application/1_abcdefghijklmnopqrstuvwxyz/2_ABCDEFGHIJKLMNOPQRSTUVWXYZ/3_abcdefghijklmnopqrstuvwxyz/4_ABCDEFGHIJKLMNOPQRSTUVWXYZ/5_abcdefghijklmnopqrstuvwxyz/6_ABCDEFGHIJKLMNOPQRSTUVWXYZ/7_abcdefg
Error: doesn't exist

So there seems something inside of TortoiseSVN which breaks checkout and export of those long Urls.

[1] http://msdn.microsoft.com/en-us/library/aa365247%28VS.85%29.aspx#maxpath

[2] CygWin internally does the same, BTW, so I can use CygWin bash to navigate in and delete those deep directory trees where the windows explorer and cmd.exe refuse to work.

[3] The often mentioned count of 260 chars includes the terminating null byte.

Best regards

Markus Schaber

We software Automation.
3S-Smart Software Solutions GmbH
Markus Schaber | Developer
Memminger Str. 151 | 87439 Kempten | Germany | Tel. +49-831-54031-0 | Fax +49-831-54031-50
Email: m.schaber@3s-software.com | Web: http://www.3s-software.com 
CoDeSys internet forum: http://forum.3s-software.com
Download CoDeSys sample projects: http://www.3s-software.com/index.shtml?sample_projects
Managing Directors: Dipl.Inf. Dieter Hess, Dipl.Inf. Manfred Werner | Trade register: Kempten HRB 6186 | Tax ID No.: DE 167014915
To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2012-02-07 09:42:56 CET

This is an archived mail posted to the TortoiseSVN Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.