rewrite-log
author Volker.Kleinfeld@gmx.de
Tue, 20 Sep 2005 19:25:14 -0700
changeset 1283 f5faab34f32e
parent 141 5f471a75d607
permissions -rw-r--r--
Support for the distutils extention 'py2exe' added. Description: - If the py2exe distutils extention is installed this patch allows building standalone exe for windows - example: > python setup.py build --compiler=mingw32 py2exe - The 'out of the box' py2exe is not able to resolve the dependencies due to 'demandload'. A new helper module of scanning the mercurial package has been added. Changed: - setup.py: importing py2exe and sub classing its command class to fetch the build directory and insert the needed includes - packagescan.py: new helper module added, that scans the distutil build directory for modules to be included.

#!/usr/bin/env python
import sys, os
from mercurial import hg

f = sys.argv[1]

r1 = hg.revlog(open, f + ".i", f + ".d")
r2 = hg.revlog(open, f + ".i2", f + ".d2")

tr = hg.transaction(open, "journal")

for i in xrange(r1.count()):
    n = r1.node(i)
    p1, p2 = r1.parents(n)
    l = r1.linkrev(n)
    t = r1.revision(n)
    n2 = r2.addrevision(t, tr, l, p1, p2)
tr.close()

os.rename(f + ".i", f + ".i.old")
os.rename(f + ".d", f + ".d.old")
os.rename(f + ".i2", f + ".i")
os.rename(f + ".d2", f + ".d")