[PATCH] Allow manipulating files with long names on Windows

Matt Mackall mpm at selenic.com
Mon Jan 17 23:18:56 CST 2011


On Mon, 2011-01-17 at 15:50 -0500, Aaron Cohen wrote:
> On Monday, January 17, 2011, Adrian Buehlmann <adrian at cadifra.com> wrote:
> > I don't see any test cases using util.posixfile here. And I have some
> > doubts the extension works with util.posixfile on Windows. Can you prove
> > me wrong?
> >
> > (util.posixfile is pretty heavily used by Mercurial on Windows)
> 
> That reminds me of another question I had. What's the rationale of the
> duplicate functions in util in general? Take posixfile, why create a
> second function rather than replacing __builtin__.open with a version
> that "does the right thing?

Replacing built-ins is asking for trouble. Consider running Mercurial is
a WSGI environment for instance.

(Note that same reasoning doesn't apply to what we do with import. We
only do that when running from the command line, and extensions have to
play by -our- rules.)

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list