This augments the contents of the PATCHES file, so that mq-based builds
do not need to maintain that file.
#!/bin/sh --
+list_patches_PATCHES () {
+ cat PATCHES
+}
+
+list_patches_mq () {
+ hg qapplied | sed -e 's/^/mq-/'
+}
+
+list_patches () {
+ if [ -f .hg/patches/series ]; then
+ list_patches_mq
+ else
+ list_patches_PATCHES
+ fi
+}
+
cat <<EOF
/* this is an autogenerated file. edit patchlist.sh instead. */
#include "config.h"
{
EOF
-while read patch ; do
+list_patches | while read patch ; do
echo " puts (\"${patch}\");"
done