rename from help/config.txt
rename to mercurial/help/config.txt
rename from help/dates.txt
rename to mercurial/help/dates.txt
rename from help/diffs.txt
rename to mercurial/help/diffs.txt
rename from help/environment.txt
rename to mercurial/help/environment.txt
rename from help/extensions.txt
rename to mercurial/help/extensions.txt
rename from help/multirevs.txt
rename to mercurial/help/multirevs.txt
rename from help/patterns.txt
rename to mercurial/help/patterns.txt
rename from help/revisions.txt
rename to mercurial/help/revisions.txt
rename from help/templates.txt
rename to mercurial/help/templates.txt
rename from help/urls.txt
rename to mercurial/help/urls.txt
rename from templates/atom/changelog.tmpl
rename to mercurial/templates/atom/changelog.tmpl
rename from templates/atom/changelogentry.tmpl
rename to mercurial/templates/atom/changelogentry.tmpl
rename from templates/atom/error.tmpl
rename to mercurial/templates/atom/error.tmpl
rename from templates/atom/filelog.tmpl
rename to mercurial/templates/atom/filelog.tmpl
rename from templates/atom/header.tmpl
rename to mercurial/templates/atom/header.tmpl
rename from templates/atom/map
rename to mercurial/templates/atom/map
rename from templates/atom/tagentry.tmpl
rename to mercurial/templates/atom/tagentry.tmpl
rename from templates/atom/tags.tmpl
rename to mercurial/templates/atom/tags.tmpl
rename from templates/coal/header.tmpl
rename to mercurial/templates/coal/header.tmpl
rename from templates/coal/map
rename to mercurial/templates/coal/map
rename from templates/gitweb/branches.tmpl
rename to mercurial/templates/gitweb/branches.tmpl
rename from templates/gitweb/changelog.tmpl
rename to mercurial/templates/gitweb/changelog.tmpl
rename from templates/gitweb/changelogentry.tmpl
rename to mercurial/templates/gitweb/changelogentry.tmpl
rename from templates/gitweb/changeset.tmpl
rename to mercurial/templates/gitweb/changeset.tmpl
rename from templates/gitweb/error.tmpl
rename to mercurial/templates/gitweb/error.tmpl
rename from templates/gitweb/fileannotate.tmpl
rename to mercurial/templates/gitweb/fileannotate.tmpl
rename from templates/gitweb/filediff.tmpl
rename to mercurial/templates/gitweb/filediff.tmpl
rename from templates/gitweb/filelog.tmpl
rename to mercurial/templates/gitweb/filelog.tmpl
rename from templates/gitweb/filerevision.tmpl
rename to mercurial/templates/gitweb/filerevision.tmpl
rename from templates/gitweb/footer.tmpl
rename to mercurial/templates/gitweb/footer.tmpl
rename from templates/gitweb/graph.tmpl
rename to mercurial/templates/gitweb/graph.tmpl
rename from templates/gitweb/header.tmpl
rename to mercurial/templates/gitweb/header.tmpl
rename from templates/gitweb/index.tmpl
rename to mercurial/templates/gitweb/index.tmpl
rename from templates/gitweb/manifest.tmpl
rename to mercurial/templates/gitweb/manifest.tmpl
rename from templates/gitweb/map
rename to mercurial/templates/gitweb/map
rename from templates/gitweb/notfound.tmpl
rename to mercurial/templates/gitweb/notfound.tmpl
rename from templates/gitweb/search.tmpl
rename to mercurial/templates/gitweb/search.tmpl
rename from templates/gitweb/shortlog.tmpl
rename to mercurial/templates/gitweb/shortlog.tmpl
rename from templates/gitweb/summary.tmpl
rename to mercurial/templates/gitweb/summary.tmpl
rename from templates/gitweb/tags.tmpl
rename to mercurial/templates/gitweb/tags.tmpl
rename from templates/map-cmdline.changelog
rename to mercurial/templates/map-cmdline.changelog
rename from templates/map-cmdline.compact
rename to mercurial/templates/map-cmdline.compact
rename from templates/map-cmdline.default
rename to mercurial/templates/map-cmdline.default
rename from templates/monoblue/branches.tmpl
rename to mercurial/templates/monoblue/branches.tmpl
rename from templates/monoblue/changelog.tmpl
rename to mercurial/templates/monoblue/changelog.tmpl
rename from templates/monoblue/changelogentry.tmpl
rename to mercurial/templates/monoblue/changelogentry.tmpl
rename from templates/monoblue/changeset.tmpl
rename to mercurial/templates/monoblue/changeset.tmpl
rename from templates/monoblue/error.tmpl
rename to mercurial/templates/monoblue/error.tmpl
rename from templates/monoblue/fileannotate.tmpl
rename to mercurial/templates/monoblue/fileannotate.tmpl
rename from templates/monoblue/filediff.tmpl
rename to mercurial/templates/monoblue/filediff.tmpl
rename from templates/monoblue/filelog.tmpl
rename to mercurial/templates/monoblue/filelog.tmpl
rename from templates/monoblue/filerevision.tmpl
rename to mercurial/templates/monoblue/filerevision.tmpl
rename from templates/monoblue/footer.tmpl
rename to mercurial/templates/monoblue/footer.tmpl
rename from templates/monoblue/graph.tmpl
rename to mercurial/templates/monoblue/graph.tmpl
rename from templates/monoblue/header.tmpl
rename to mercurial/templates/monoblue/header.tmpl
rename from templates/monoblue/index.tmpl
rename to mercurial/templates/monoblue/index.tmpl
rename from templates/monoblue/manifest.tmpl
rename to mercurial/templates/monoblue/manifest.tmpl
rename from templates/monoblue/map
rename to mercurial/templates/monoblue/map
rename from templates/monoblue/notfound.tmpl
rename to mercurial/templates/monoblue/notfound.tmpl
rename from templates/monoblue/search.tmpl
rename to mercurial/templates/monoblue/search.tmpl
rename from templates/monoblue/shortlog.tmpl
rename to mercurial/templates/monoblue/shortlog.tmpl
rename from templates/monoblue/summary.tmpl
rename to mercurial/templates/monoblue/summary.tmpl
rename from templates/monoblue/tags.tmpl
rename to mercurial/templates/monoblue/tags.tmpl
rename from templates/paper/branches.tmpl
rename to mercurial/templates/paper/branches.tmpl
rename from templates/paper/changeset.tmpl
rename to mercurial/templates/paper/changeset.tmpl
rename from templates/paper/error.tmpl
rename to mercurial/templates/paper/error.tmpl
rename from templates/paper/fileannotate.tmpl
rename to mercurial/templates/paper/fileannotate.tmpl
rename from templates/paper/filediff.tmpl
rename to mercurial/templates/paper/filediff.tmpl
rename from templates/paper/filelog.tmpl
rename to mercurial/templates/paper/filelog.tmpl
rename from templates/paper/filelogentry.tmpl
rename to mercurial/templates/paper/filelogentry.tmpl
rename from templates/paper/filerevision.tmpl
rename to mercurial/templates/paper/filerevision.tmpl
rename from templates/paper/footer.tmpl
rename to mercurial/templates/paper/footer.tmpl
rename from templates/paper/graph.tmpl
rename to mercurial/templates/paper/graph.tmpl
rename from templates/paper/header.tmpl
rename to mercurial/templates/paper/header.tmpl
rename from templates/paper/index.tmpl
rename to mercurial/templates/paper/index.tmpl
rename from templates/paper/manifest.tmpl
rename to mercurial/templates/paper/manifest.tmpl
rename from templates/paper/map
rename to mercurial/templates/paper/map
rename from templates/paper/notfound.tmpl
rename to mercurial/templates/paper/notfound.tmpl
rename from templates/paper/search.tmpl
rename to mercurial/templates/paper/search.tmpl
rename from templates/paper/shortlog.tmpl
rename to mercurial/templates/paper/shortlog.tmpl
rename from templates/paper/shortlogentry.tmpl
rename to mercurial/templates/paper/shortlogentry.tmpl
rename from templates/paper/tags.tmpl
rename to mercurial/templates/paper/tags.tmpl
rename from templates/raw/changeset.tmpl
rename to mercurial/templates/raw/changeset.tmpl
rename from templates/raw/error.tmpl
rename to mercurial/templates/raw/error.tmpl
rename from templates/raw/fileannotate.tmpl
rename to mercurial/templates/raw/fileannotate.tmpl
rename from templates/raw/filediff.tmpl
rename to mercurial/templates/raw/filediff.tmpl
rename from templates/raw/index.tmpl
rename to mercurial/templates/raw/index.tmpl
rename from templates/raw/manifest.tmpl
rename to mercurial/templates/raw/manifest.tmpl
rename from templates/raw/map
rename to mercurial/templates/raw/map
rename from templates/raw/notfound.tmpl
rename to mercurial/templates/raw/notfound.tmpl
rename from templates/rss/changelog.tmpl
rename to mercurial/templates/rss/changelog.tmpl
rename from templates/rss/changelogentry.tmpl
rename to mercurial/templates/rss/changelogentry.tmpl
rename from templates/rss/error.tmpl
rename to mercurial/templates/rss/error.tmpl
rename from templates/rss/filelog.tmpl
rename to mercurial/templates/rss/filelog.tmpl
rename from templates/rss/filelogentry.tmpl
rename to mercurial/templates/rss/filelogentry.tmpl
rename from templates/rss/header.tmpl
rename to mercurial/templates/rss/header.tmpl
rename from templates/rss/map
rename to mercurial/templates/rss/map
rename from templates/rss/tagentry.tmpl
rename to mercurial/templates/rss/tagentry.tmpl
rename from templates/rss/tags.tmpl
rename to mercurial/templates/rss/tags.tmpl
rename from templates/spartan/branches.tmpl
rename to mercurial/templates/spartan/branches.tmpl
rename from templates/spartan/changelog.tmpl
rename to mercurial/templates/spartan/changelog.tmpl
rename from templates/spartan/changelogentry.tmpl
rename to mercurial/templates/spartan/changelogentry.tmpl
rename from templates/spartan/changeset.tmpl
rename to mercurial/templates/spartan/changeset.tmpl
rename from templates/spartan/error.tmpl
rename to mercurial/templates/spartan/error.tmpl
rename from templates/spartan/fileannotate.tmpl
rename to mercurial/templates/spartan/fileannotate.tmpl
rename from templates/spartan/filediff.tmpl
rename to mercurial/templates/spartan/filediff.tmpl
rename from templates/spartan/filelog.tmpl
rename to mercurial/templates/spartan/filelog.tmpl
rename from templates/spartan/filelogentry.tmpl
rename to mercurial/templates/spartan/filelogentry.tmpl
rename from templates/spartan/filerevision.tmpl
rename to mercurial/templates/spartan/filerevision.tmpl
rename from templates/spartan/footer.tmpl
rename to mercurial/templates/spartan/footer.tmpl
rename from templates/spartan/graph.tmpl
rename to mercurial/templates/spartan/graph.tmpl
rename from templates/spartan/header.tmpl
rename to mercurial/templates/spartan/header.tmpl
rename from templates/spartan/index.tmpl
rename to mercurial/templates/spartan/index.tmpl
rename from templates/spartan/manifest.tmpl
rename to mercurial/templates/spartan/manifest.tmpl
rename from templates/spartan/map
rename to mercurial/templates/spartan/map
rename from templates/spartan/notfound.tmpl
rename to mercurial/templates/spartan/notfound.tmpl
rename from templates/spartan/search.tmpl
rename to mercurial/templates/spartan/search.tmpl
rename from templates/spartan/shortlog.tmpl
rename to mercurial/templates/spartan/shortlog.tmpl
rename from templates/spartan/shortlogentry.tmpl
rename to mercurial/templates/spartan/shortlogentry.tmpl
rename from templates/spartan/tags.tmpl
rename to mercurial/templates/spartan/tags.tmpl
rename from templates/static/background.png
rename to mercurial/templates/static/background.png
rename from templates/static/coal-file.png
rename to mercurial/templates/static/coal-file.png
rename from templates/static/coal-folder.png
rename to mercurial/templates/static/coal-folder.png
rename from templates/static/excanvas.js
rename to mercurial/templates/static/excanvas.js
rename from templates/static/graph.js
rename to mercurial/templates/static/graph.js
rename from templates/static/hgicon.png
rename to mercurial/templates/static/hgicon.png
rename from templates/static/hglogo.png
rename to mercurial/templates/static/hglogo.png
rename from templates/static/style-coal.css
rename to mercurial/templates/static/style-coal.css
rename from templates/static/style-gitweb.css
rename to mercurial/templates/static/style-gitweb.css
rename from templates/static/style-monoblue.css
rename to mercurial/templates/static/style-monoblue.css
rename from templates/static/style-paper.css
rename to mercurial/templates/static/style-paper.css
rename from templates/static/style.css
rename to mercurial/templates/static/style.css
rename from templates/template-vars.txt
rename to mercurial/templates/template-vars.txt
--- a/setup.py
+++ b/setup.py
@@ -165,12 +165,6 @@
except ImportError:
version = 'unknown'
-class install_package_data(install_data):
- def finalize_options(self):
- self.set_undefined_options('install',
- ('install_lib', 'install_dir'))
- install_data.finalize_options(self)
-
class build_mo(build):
description = "build translations (.mo files)"
@@ -193,16 +187,17 @@
pofile = join(podir, po)
modir = join('locale', po[:-3], 'LC_MESSAGES')
mofile = join(modir, 'hg.mo')
- cmd = ['msgfmt', '-v', '-o', mofile, pofile]
+ mobuildfile = join('mercurial', mofile)
+ cmd = ['msgfmt', '-v', '-o', mobuildfile, pofile]
if sys.platform != 'sunos5':
# msgfmt on Solaris does not know about -c
cmd.append('-c')
- self.mkpath(modir)
- self.make_file([pofile], mofile, spawn, (cmd,))
- self.distribution.data_files.append((join('mercurial', modir),
- [mofile]))
+ self.mkpath(join('mercurial', modir))
+ self.make_file([pofile], mobuildfile, spawn, (cmd,))
-build.sub_commands.append(('build_mo', None))
+# Insert build_mo first so that files in mercurial/locale/ are found
+# when build_py is run next.
+build.sub_commands.insert(0, ('build_mo', None))
Distribution.pure = 0
Distribution.global_options.append(('pure', None, "use pure (slow) Python "
@@ -230,8 +225,7 @@
else:
yield module
-cmdclass = {'install_data': install_package_data,
- 'build_mo': build_mo,
+cmdclass = {'build_mo': build_mo,
'build_py': hg_build_py}
ext_modules=[
@@ -255,13 +249,21 @@
['hgext/inotify/linux/_inotify.c']))
packages.extend(['hgext.inotify', 'hgext.inotify.linux'])
+packagedata = {'mercurial': ['locale/*/LC_MESSAGES/hg.mo',
+ 'help/*.txt']}
+
+def ordinarypath(p):
+ return p and p[0] != '.' and p[-1] != '~'
+
+for root in ('templates', ):
+ for curdir, dirs, files in os.walk(os.path.join('mercurial', root)):
+ curdir = curdir.split(os.sep, 1)[1]
+ dirs[:] = filter(ordinarypath, dirs)
+ for f in filter(ordinarypath, files):
+ f = os.path.join(curdir, f)
+ packagedata['mercurial'].append(f)
+
datafiles = []
-for root in ('templates', 'help'):
- for dir, dirs, files in os.walk(root):
- dirs[:] = [x for x in dirs if not x.startswith('.')]
- files = [x for x in files if not x.startswith('.')]
- datafiles.append((os.path.join('mercurial', dir),
- [os.path.join(dir, file_) for file_ in files]))
setup(name='mercurial',
version=version,
@@ -274,6 +276,7 @@
packages=packages,
ext_modules=ext_modules,
data_files=datafiles,
+ package_data=packagedata,
cmdclass=cmdclass,
options=dict(py2exe=dict(packages=['hgext', 'email']),
bdist_mpkg=dict(zipdist=True,