packaging: include templates with their package as key in package_data
This is similar to an earlier patch in this series. It seems more
correct to use `mercurial.templates.coal` etc as keys in the
`package_data` dict now that those modules are packages.
Differential Revision: https://phab.mercurial-scm.org/D8858
--- a/setup.py Fri Jul 31 09:49:52 2020 -0700
+++ b/setup.py Fri Jul 31 10:05:07 2020 -0700
@@ -1635,10 +1635,8 @@
for root in ('templates',):
for curdir, dirs, files in os.walk(os.path.join('mercurial', root)):
- curdir = curdir.split(os.sep, 1)[1]
- for f in filter(ordinarypath, files):
- f = os.path.join(curdir, f)
- packagedata['mercurial'].append(f)
+ packagename = curdir.replace(os.sep, '.')
+ packagedata[packagename] = list(filter(ordinarypath, files))
datafiles = []