pure-python mercurial

Weijun Wang Weijun.Wang at Sun.COM
Tue Mar 3 21:20:33 CST 2009


Matt Mackall wrote:
> On Wed, 2009-03-04 at 10:14 +0800, Weijun Wang wrote:
>> Of course.
>>
>> How much the degradation would be? If it's within 200% of time for
>> normal actions, I can accept it.
> 
> Depends on the operation. Some things (base85-encoding) are 100x slower.
> Other things might be .5x slower.
> 

I see.

So what's the ultimate purpose for this new feature? I think gcc is much
popular than Jython on any system. Or, it means hg can be directly
called without building it on any platform? How about doing a
compile-on-demand for the worst cases like base95-encoding?

Also, I guess you won't throw away the C mode at all, and maybe you will
add some detect codes like this:

  if [ -e so files && platform is correct ]; then
    choose the C mode
  elif [ -e jython ]; then
    choose the Jython mode
  else
    choose the pure-python mode
  fi

In fact, I'm now working on multiple platforms and my hg is in a shared
NFS directory. In order to play well on all sides, I have to patch it to
put .so files into

    "mercurial/" + platform.system() + "-" +
    platform.architecture()[0] + "-" + platform.processor() + "-" +
    str(sys.version_info[0]) + "." + str(sys.version_info[1])'`

Thanks
Max


More information about the Mercurial mailing list