# HG changeset patch
# User paugier <pierre.augier@univ-grenoble-alpes.fr>
# Date 1738188612 -3600
#      Wed Jan 29 23:10:12 2025 +0100
# Node ID 3d86baf182a58a86b783eda4d26753c5ad8dc35f
# Parent  6a7b0d0f090da78d656c5321a280def8a96a021b
build: static and versioned MANIFEST.in with setuptools-scm

Now that setuptools-scm is used, it is better to have a static MANIFEST.in file.

From https://setuptools-scm.readthedocs.io:

> Additionally setuptools-scm provides setuptools with a list of files that
> are managed by the SCM (i.e. it automatically adds all the SCM-managed files to the sdist).

diff --git a/.hgignore b/.hgignore
--- a/.hgignore
+++ b/.hgignore
@@ -52,8 +52,6 @@
 doc/build
 doc/html
 doc/man
-MANIFEST
-MANIFEST.in
 patches
 mercurial/__modulepolicy__.py
 mercurial/__version__.py
diff --git a/MANIFEST.in b/MANIFEST.in
new file mode 100644
--- /dev/null
+++ b/MANIFEST.in
@@ -0,0 +1,5 @@
+include mercurial/__version__.py
+include doc/*.html
+include doc/*.1 doc/*.5 doc/*.8
+include doc/html/*.html
+include doc/man/*.1
diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -87,7 +87,7 @@
 	find contrib doc hgext hgext3rd i18n mercurial tests hgdemandimport \
 		\( -name '*.py[cdo]' -o -name '*.so' \) -exec rm -f '{}' ';'
 	rm -rf .venv_*
-	rm -f MANIFEST MANIFEST.in hgext/__index__.py tests/*.err
+	rm -f hgext/__index__.py tests/*.err
 	rm -f mercurial/__modulepolicy__.py
 	if test -d .hg; then rm -f mercurial/__version__.py; fi
 	rm -rf build mercurial/locale
@@ -121,17 +121,9 @@
 install-rhg: build-rhg
 	install -m 755 rust/target/release/rhg "$(PREFIX)"/bin/
 
-MANIFEST-doc:
-	$(MAKE) -C doc MANIFEST
-
-MANIFEST.in: MANIFEST-doc
-	hg manifest | sed -e 's/^/include /' > MANIFEST.in
-	echo include mercurial/__version__.py >> MANIFEST.in
-	sed -e 's/^/include /' < doc/MANIFEST >> MANIFEST.in
-
 dist:	tests dist-notests
 
-dist-notests:	doc MANIFEST.in
+dist-notests:	doc
 	TAR_OPTIONS="--owner=root --group=root --mode=u+w,go-w,a+rX-s" $(PYTHON) setup.py -q sdist
 
 check: tests
diff --git a/doc/Makefile b/doc/Makefile
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -206,13 +206,6 @@
 	$(PYTHON) runrst html --hg-individual-pages $(RSTARGS) --halt warning \
 	  --link-stylesheet --stylesheet-path style.css $(BUILDDIR)/$*.gendoc.txt $@
 
-MANIFEST: man html
-# tracked files are already in the main MANIFEST
-	$(RM) $@
-	for i in $(MAN) $(HTML); do \
-	  echo "doc/$$i" >> $@ ; \
-	done
-
 install: man
 	for i in $(MAN) ; do \
 	  subdir=`echo $$i | sed -n 's/^.*\.\([0-9]\)$$/man\1/p'` ; \
@@ -225,4 +218,4 @@
 # $(HTML) only has the basic topics, so we need to delete $(HTMLOUT)/*.html and
 # other similar files "by hand" here.
 clean:
-	$(RM) $(MAN) $(HTML) common.txt $(SOURCES) MANIFEST *.gendoc.txt $(BUILDFILES) $(BUILDDIR)/*.gendoc.* $(HTMLOUT)/*.html
+	$(RM) $(MAN) $(HTML) common.txt $(SOURCES) *.gendoc.txt $(BUILDFILES) $(BUILDDIR)/*.gendoc.* $(HTMLOUT)/*.html
diff --git a/tests/test-check-code.t b/tests/test-check-code.t
--- a/tests/test-check-code.t
+++ b/tests/test-check-code.t
@@ -65,6 +65,7 @@
   CONTRIBUTING
   CONTRIBUTORS
   COPYING
+  MANIFEST.in
   Makefile
   README.rst
   hg