Windows long path experimenting report

Peter Arrenbrecht peter.arrenbrecht at gmail.com
Fri Jun 20 10:03:57 CDT 2008


On Fri, Jun 20, 2008 at 4:59 PM, Paul Moore <p.f.moore at gmail.com> wrote:
> On 20/06/2008, Peter Arrenbrecht <peter.arrenbrecht at gmail.com> wrote:
>> In the hope of further stimulating the discussion, I have another
>> proposal, even though it is not fully satisfactory to me at this
>> point. It follows Adrian's and Patrick's idea that maybe we should
>> accept the need for a different format and, thus, manual intervention
>> when filesystem-level interoperability is desired[1]. This could also
>> be applied to your proposal, meaning it would be optional to turn on
>> the encoding you propose.
> [...]
>
> Interesting. I'm sure there's scope for something here. Just the idea
> that multiple encodings are possible, selected at clone time, is
> useful. That way people have the choice when needed, but don't suffer
> unless it's necessary.
>
>> Problems:
>>
>> It seems the max path length is really a limit on the total length. So
>> when configuring the max repo store path length, one would really have
>> to take into account the length of the path to the repo itself. And
>> that would limit the locations it could then be copied to. Horrid.
>> This is why I currently propose a limit of 260/2 for Windows' default
>> as a compromise.
>
> Hmm, rather than do this, I'd suggest allowing for up to MAX_PATH
> (maybe MAX_PATH-3, see below) and leave it up to the user (with a
> suitable warning, if Mercurial hits a problem) to locate the
> repository appropriately. (MAX_PATH-3 ensures that putting the repo at
> C:\ will always work).

Would have to be MAX_PATH-len('C:\name-of-the repo\.hg\store'), no?
What's particularly relevant here is the unknown
len('name-of-the-repo'). So I'm not sure it is a good idea to approach
MAX_PATH too closely.

>
> From this discussion, I get the impression that people aren't
> considering limits on platforms other than Windows. Is that right? Is
> it the case that on modern Unix, and MAC OS, MAX_PATH is essentially
> infinite? My recollection is that MAX_PATH was quite small in the
> early days of Unix. (Not that it makes much difference, I'm just
> curious).
>
> Paul
>


More information about the Mercurial-devel mailing list