[PATCH 0 of 1 STABLE RFC] Remove os.path.realpath workaround for darwin

Christian Ebert blacktrash at gmx.net
Sun Oct 30 07:08:51 CDT 2011


* Matt Mackall on Saturday, October 29, 2011 at 11:08:15 -0500
> On Sat, 2011-10-29 at 14:31 +0200, Christian Ebert wrote:
>> Hi,
>> 
>> Sending this to provoke some kind of reaction ;-)
>> 
>> I'm sure Dan's darwin workaround for os.path.realpath is still
>> needed in certain Python - OS X combinations. However, it does
>> the wrong thing on my machine: MacOS 10.5.8 and Python 2.7 or
>> Python 2.5 whereas os.path.realpath gets it right.
>> 
>> This appeared only after ab600a25dfc0 actually put util.realpath
>> to use.
> 
> You left off the bug number: "(issue3071)"

Sorry about that.

> Please see:
> 
> http://mercurial.selenic.com/bts/issue3078
> 
> I've pushed a backout of this change:
> 
> http://www.selenic.com/hg/rev/42630f54e513
> 
> Please try that locally and let me know if it's sufficient or if I need
> to also back out:
> 
> http://www.selenic.com/hg/rev/ab600a25dfc0

No. I was mislead there. Again, sorry, I'm currently very
stressed about other things than Mercurial.

This one should be reverted then:
http://www.selenic.com/hg/rev/dbdb777502dc

Basically _every_ instance of util.realpath. Because the darwin
part of util.realpath which avoids os.path.realpath does the
wrong thing whereas just leaving os.path.realpath does it right.

But that's just doctoring on the symptoms. The root cause imho is
the darwin clause in posix.realpath introduced in this changeset:
http://www.selenic.com/hg/rev/40196d036a71
(which is why I included Dan)

And
http://www.selenic.com/hg/rev/dbdb777502dc
http://www.selenic.com/hg/rev/42630f54e513
only made the problem visible, because they replace
os.path.realpath doing the right thing with util.realpath doing
the wrong thing.

However, I believe there must have been a reason for
http://www.selenic.com/hg/rev/40196d036a71
I suppose some combination of MacOS and/or Python versions.
But on 10.5.8 with Python 2.5 or Python 2.7 the workaround
prevents os.path.realpath from doing the right thing.

The true cure would probably be to narrow down the clause in line
167 in poslix.py:

if sys.platform == 'darwin':

to python and/or darwin versions where it is actually needed. But
with what I have on my machine I cannot produce a condition where
it is needed, which is why I asked for feedback.

I hope it's clearer now.

c
-- 
theatre - books - texts - movies
Black Trash Productions at home: http://www.blacktrash.org
Black Trash Productions on Facebook:
http://www.facebook.com/blacktrashproductions


More information about the Mercurial-devel mailing list