annotate setup.py @ 1076:01db658cc78a

tarball support v0.3 Hello, I'm slowly improving support for tarballs in Mercurial. Attached patch is made against current tip in Matt's repository - f859e9cba1b9, and contains everything done so far. Changes: - gzip and bzip2 tarballs are sent immediately without writing to temporary files (I was wrong Matt, it can be done very easy) - hgrc customization, you can choose which type (if any) you will support There's no easy way to support compression levels, since TarFile open() assume that it is 9. I tried to use gzopen(), and bz2open() methods instead, but it seems that headers of generated archives, are missing or wrong. We could eventually try to rewrite tarfile.py and include our own version into Mercurial, but I don't know if it's good idea... Wojtek
author Wojciech Milkowski <wmilkowski@interia.pl>
date Fri, 26 Aug 2005 20:51:34 -0700
parents 7f5ce4bbdd7b
children f5faab34f32e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
1 #!/usr/bin/env python
575
7f5ce4bbdd7b More whitespace cleanups
mpm@selenic.com
parents: 429
diff changeset
2 #
7f5ce4bbdd7b More whitespace cleanups
mpm@selenic.com
parents: 429
diff changeset
3 # This is the mercurial setup script.
0
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
4 #
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
5 # './setup.py install', or
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
6 # './setup.py --help' for more options
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
7
157
2653740d8118 Install the templates where they can be found by hgweb.py
mpm@selenic.com
parents: 155
diff changeset
8 import glob
72
4a6ab4d80dc4 Add an O(m + nlog n) patching extension
mpm@selenic.com
parents: 67
diff changeset
9 from distutils.core import setup, Extension
157
2653740d8118 Install the templates where they can be found by hgweb.py
mpm@selenic.com
parents: 155
diff changeset
10 from distutils.command.install_data import install_data
2653740d8118 Install the templates where they can be found by hgweb.py
mpm@selenic.com
parents: 155
diff changeset
11
423
25afb21d97ba Support for 'hg --version'. setup.py stores version from hg repository.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 241
diff changeset
12 import mercurial.version
25afb21d97ba Support for 'hg --version'. setup.py stores version from hg repository.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 241
diff changeset
13
427
36e644d28edf Make it possible to specify a version number in setup.py.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 423
diff changeset
14 # specify version string, otherwise 'hg identify' will be used:
36e644d28edf Make it possible to specify a version number in setup.py.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 423
diff changeset
15 version = ''
36e644d28edf Make it possible to specify a version number in setup.py.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 423
diff changeset
16
157
2653740d8118 Install the templates where they can be found by hgweb.py
mpm@selenic.com
parents: 155
diff changeset
17 class install_package_data(install_data):
2653740d8118 Install the templates where they can be found by hgweb.py
mpm@selenic.com
parents: 155
diff changeset
18 def finalize_options(self):
2653740d8118 Install the templates where they can be found by hgweb.py
mpm@selenic.com
parents: 155
diff changeset
19 self.set_undefined_options('install',
2653740d8118 Install the templates where they can be found by hgweb.py
mpm@selenic.com
parents: 155
diff changeset
20 ('install_lib', 'install_dir'))
2653740d8118 Install the templates where they can be found by hgweb.py
mpm@selenic.com
parents: 155
diff changeset
21 install_data.finalize_options(self)
0
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
22
423
25afb21d97ba Support for 'hg --version'. setup.py stores version from hg repository.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 241
diff changeset
23 try:
427
36e644d28edf Make it possible to specify a version number in setup.py.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 423
diff changeset
24 mercurial.version.remember_version(version)
423
25afb21d97ba Support for 'hg --version'. setup.py stores version from hg repository.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 241
diff changeset
25 setup(name='mercurial',
429
688d03d6997a Pull from TAH
mpm@selenic.com
parents: 400 427
diff changeset
26 version=mercurial.version.get_version(),
688d03d6997a Pull from TAH
mpm@selenic.com
parents: 400 427
diff changeset
27 author='Matt Mackall',
688d03d6997a Pull from TAH
mpm@selenic.com
parents: 400 427
diff changeset
28 author_email='mpm@selenic.com',
688d03d6997a Pull from TAH
mpm@selenic.com
parents: 400 427
diff changeset
29 url='http://selenic.com/mercurial',
688d03d6997a Pull from TAH
mpm@selenic.com
parents: 400 427
diff changeset
30 description='scalable distributed SCM',
688d03d6997a Pull from TAH
mpm@selenic.com
parents: 400 427
diff changeset
31 license='GNU GPL',
688d03d6997a Pull from TAH
mpm@selenic.com
parents: 400 427
diff changeset
32 packages=['mercurial'],
688d03d6997a Pull from TAH
mpm@selenic.com
parents: 400 427
diff changeset
33 ext_modules=[Extension('mercurial.mpatch', ['mercurial/mpatch.c']),
688d03d6997a Pull from TAH
mpm@selenic.com
parents: 400 427
diff changeset
34 Extension('mercurial.bdiff', ['mercurial/bdiff.c'])],
688d03d6997a Pull from TAH
mpm@selenic.com
parents: 400 427
diff changeset
35 data_files=[('mercurial/templates',
688d03d6997a Pull from TAH
mpm@selenic.com
parents: 400 427
diff changeset
36 ['templates/map'] +
688d03d6997a Pull from TAH
mpm@selenic.com
parents: 400 427
diff changeset
37 glob.glob('templates/map-*') +
575
7f5ce4bbdd7b More whitespace cleanups
mpm@selenic.com
parents: 429
diff changeset
38 glob.glob('templates/*.tmpl'))],
429
688d03d6997a Pull from TAH
mpm@selenic.com
parents: 400 427
diff changeset
39 cmdclass = { 'install_data' : install_package_data },
688d03d6997a Pull from TAH
mpm@selenic.com
parents: 400 427
diff changeset
40 scripts=['hg', 'hgmerge'])
423
25afb21d97ba Support for 'hg --version'. setup.py stores version from hg repository.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 241
diff changeset
41 finally:
25afb21d97ba Support for 'hg --version'. setup.py stores version from hg repository.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 241
diff changeset
42 mercurial.version.forget_version()