<<< Date Index >>>     <<< Thread Index >>>

[PATCH 2 of 2] Include mq-based patches in the mutt patch list



# HG changeset patch
# User David Champion <dgc@xxxxxxxxxxxx>
# Date 1294082391 21600
# Branch HEAD
# Node ID e430a60a325be04cc5290b0ce2f634ad462de3da
# Parent  d1f81b853d65d09313f24bbe26e6d873029b516d
Include mq-based patches in the mutt patch list.

This augments the contents of the PATCHES file, so that mq-based builds
do not need to maintain that file.

diff --git a/patchlist.sh b/patchlist.sh
--- a/patchlist.sh
+++ b/patchlist.sh
@@ -1,5 +1,21 @@
 #!/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"
@@ -13,7 +29,7 @@
 {
 EOF
 
-while read patch ; do
+list_patches | while read patch ; do
        echo "  puts (\"${patch}\");"
 done