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

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



# HG changeset patch
# User David Champion <dgc@xxxxxxxxxxxx>
# Date 1284612296 18000
# Branch HEAD
# Node ID c64a45baed14d182e4fd0f2ba24acee832d862f4
# Parent  1c6c5a4e168219a6e26ba6143cabe9f7564dfcac
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 -r 1c6c5a4e1682 -r c64a45baed14 patchlist.sh
--- a/patchlist.sh      Wed Sep 15 23:44:54 2010 -0500
+++ b/patchlist.sh      Wed Sep 15 23:44:56 2010 -0500
@@ -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