Windows long path experimenting report

Adrian Buehlmann adrian at cadifra.com
Sun Jun 22 03:30:03 CDT 2008


On 20.06.2008 09:12, Adrian Buehlmann wrote:
> On 20.06.2008 08:35, Peter Arrenbrecht wrote:
>> Besides, \\?\ will also enable us to not only clone such repos, but
>> populate the working copy with long/reserved names.
> 
> No. I'm only treating the repo side (.hg) of Mercurial.
> 
> The working dir / dirstate side of Mercurial is an entirely
> different matter.

Hum. It seems my long path patch [1] already affects the working
dir side more than I had expected:

using 626cb86a6523 (0.4rc2 TortoiseHg):

> hg clone -U http://www.cadifra.com/cgi-bin/repos/auxtest2/
destination directory: auxtest2
requesting all changes
adding changesets
adding manifests
adding file changes
transaction abort!
rollback completed
abort: The directory name is invalid: W:\tmp\auxtest2\.hg\store\data/aux

using my long path patch

> hgt clone -U http://www.cadifra.com/cgi-bin/repos/auxtest2/
(output omitted, already posted elsewhere)

nothing new so far, but *updating* exactly that repo works too!

> cd auxtest2

> hgt update
--- running hg from W:\hg-longpath
creating file: \\?\W:\tmp\auxtest2\.hg\requires
creating file: \\?\W:\tmp\auxtest2\.hg\dirstate
creating file: \\?\W:\tmp\auxtest2\.hg\store\00changelog.i
creating file: \\?\W:\tmp\auxtest2\.hg\branch.cache
creating file: \\?\W:\tmp\auxtest2\.hg\branch
creating file: \\?\W:\tmp\auxtest2\.hg\dirstate
creating file: \\?\W:\tmp\auxtest2\.hg\dirstate
creating file: \\?\W:\tmp\auxtest2\.hg\store\00manifest.i
creating file: \\?\W:\tmp\auxtest2\.hg\merge\state
creating file: \\?\W:\tmp\auxtest2\.hg\store\data\aux\a.txt.i
called util_win32.makedirs('\\?\W:\tmp\auxtest2\aux')
CreateDirectoryW() was successful
creating file: \\?\W:\tmp\auxtest2\aux\a.txt
creating file: \\?\W:\tmp\auxtest2\.hg\branch
creating file: \\?\W:\tmp\auxtest2\.hg\.dirstate-arha2d
1 files updated, 0 files merged, 0 files removed, 0 files unresolved

which tells me that my now long-path-enabled posixfile_nt
is also used for some working dir operations.

Which means the long paths do spread into the working dir already.

Of course

> cd aux
The parameter is incorrect.

doesn't work.

Interestingly, I can navigate into auxtest2\aux with explorer
and modify auxtest2\aux\a.txt with Notepad++

But status is not prepared to this:

> hgt sta
--- running hg from W:\hg-longpath
creating file: \\?\W:\tmp\auxtest2\.hg\requires
creating file: \\?\W:\tmp\auxtest2\.hg\dirstate
creating file: \\?\W:\tmp\auxtest2\.hg\dirstate
abort: The parameter is incorrect: W:\tmp\auxtest2\.\aux

So, this means we would have to do one of

a) intentionally block reserved names / long paths on the working dir side
b) make the working dir side work with long paths too (at least to
   some minimal degree)

Decision a) feels pretty silly and pointless, so we are left with b).

Which means: yes, Peter is right when he writes:

>> Besides, \\?\ will also enable us to not only clone such repos, but
>> populate the working copy with long/reserved names.

So this means we will have to adapt the whole dirstate side.
This time, I'll refrain from guessing how much work this will be.

[1] http://selenic.com/pipermail/mercurial-devel/2008-June/006776.html


More information about the Mercurial-devel mailing list