[PATCH] Allow manipulating files with long names on Windows

timeless timeless at gmail.com
Tue Jan 25 11:51:56 CST 2011


On Tue, Jan 25, 2011 at 6:29 PM, Aaron Cohen <aaron at assonance.org> wrote:
> Well, it's also perfectly possible to create these directories in
> Windows (in IntellIJ or Eclipse for instance) and then have hg unable
> to deal with them.

> I'm not sure I understand how using symlinks would help, users would
> still end up with files on their system that traditional tools can't
> handle, they'd just be symlinks rather than files.

users would be able to at least edit the files in ignorant
applications, they'd also be able to rename the short version of files
using explorer.

> Rather than creating "short files" it might be an idea to make more
> use of the "alternateFileName" that Windows has for long files (which
> is the old 8.3 truncated filename and does look like 6chars~1), but
> I'm not sure there's any reason to since my extension seems to work
> well enough as it is.

i guess, the question is how much support should be given to programs
like windows explorer which can't handle obscenely long filenames.

> Do you mean adding a command such as "hg lfn --truncate" which would
> search for long paths in the repo and replace them with short
> versions?

perhaps. i was thinking more as a way to support both tools which
liked the long filenames (java) and tools which didn't (everything
else) in the same sort of way that 8.3 compat support was retained by
microsoft.

afaik, hg doesn't handle streams, which means you could actually use
the comment field or another stream property to track renames. heck,
we could probably always use a stream to track an original filename to
catch renames (not even related to lfn).

> I could certainly implement that if requested, but I'm not
> sure it's necessary. "hg lfn --clean" eliminates the single biggest
> gotcha which is "I've checked out this repository and now I can't
> delete it."

i basically expect to encounter projects designed by unix users where
i want to be able to clone and do work on them from windows. i expect
that your extension would enable this. being able to trash a repo and
give up on contributing to it wouldn't do me any good. being able to
submit a patch to try to rename/reorganize things so that they could
on places without your extension would be nice (again, without
requiring me to set up a unix environment).

these are of course additional potential goals, and not necessarily
things you have to support.


More information about the Mercurial-devel mailing list