From c28f4567282fa2d2b41a8c30c3c89b95e637b7d0 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 2 Apr 2007 14:23:39 -0300 Subject: Improve mailimport to auto-generate CARDLIST.* From: Mauro Carvalho Chehab Signed-off-by: Mauro Carvalho Chehab --- mailimport | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'mailimport') diff --git a/mailimport b/mailimport index 2bcd2a09f..80584af00 100755 --- a/mailimport +++ b/mailimport @@ -108,16 +108,18 @@ apply_patch () { echo hg -m "`cat $TMP2|grep -v "^#"`" qnew $name hg qnew -m "`cat $TMP2|grep -v "^#"`" $name + make cardlist make whitespace hg qrefresh else patch -s -t -p1 -l -N -d $pdir -i $next - make whitespace - if [ "$?" != "0" ]; then echo "*** ERROR at: patch -s -t -p1 -l -N -d $pdir -i $next" exit fi + make cardlist + make whitespace + cur=`pwd` cd $pdir hg addremove `diffstat -p1 -l $next` @@ -126,7 +128,8 @@ apply_patch () { exit fi # Commit the changed files - hg commit -u "$committer" -m "`cat $TMP2|grep -v "^#"`" `diffstat -p1 -l $next` + hg commit -u "$committer" -m "`cat $TMP2|grep -v "^#"`" `diffstat -p1 -l $next` linux/Documentation/video4linux/CARDLIST.* + if [ "$?" != "0" ]; then echo "*** ERROR at hg commit" cd $cur -- cgit v1.2.3 From 2c20fa5c2a3cec7aa554a2683ddfedb0eb7ec31a Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sat, 14 Apr 2007 15:36:34 -0300 Subject: Improved to handle also inlined patches From: Mauro Carvalho Chehab Signed-off-by: Mauro Carvalho Chehab --- mailimport | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'mailimport') diff --git a/mailimport b/mailimport index 80584af00..fd2169d07 100755 --- a/mailimport +++ b/mailimport @@ -140,7 +140,14 @@ apply_patch () { hg log -r -1 -v } -echo git-mailsplit $MBOX $DIR +grep -v $MBOX >$DIR/tmpbox < Date: Mon, 16 Apr 2007 10:36:46 -0300 Subject: Fix: on some cases, it will use the wrong dir for CARDLIST.foo From: Mauro Carvalho Chehab Signed-off-by: Mauro Carvalho Chehab --- mailimport | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mailimport') diff --git a/mailimport b/mailimport index fd2169d07..889193ec7 100755 --- a/mailimport +++ b/mailimport @@ -128,7 +128,7 @@ apply_patch () { exit fi # Commit the changed files - hg commit -u "$committer" -m "`cat $TMP2|grep -v "^#"`" `diffstat -p1 -l $next` linux/Documentation/video4linux/CARDLIST.* + hg commit -u "$committer" -m "`cat $TMP2|grep -v "^#"`" `diffstat -p1 -l $next` $cur/linux/Documentation/video4linux/CARDLIST.* if [ "$?" != "0" ]; then echo "*** ERROR at hg commit" -- cgit v1.2.3 From 4150c636f12b5dffa698344e849da59765b827f7 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Wed, 2 May 2007 09:51:41 -0300 Subject: Improvements at mailimport script From: Mauro Carvalho Chehab - Default editor (nano) is opened with an option to avoid line wrapping - Commit only the modified cardlists, if any, avoiding trying to commit CARDLIST.foo.rej and/or CARDLIST.foo.orig - Prevents trying to commit patches with zero diff Signed-off-by: Mauro Carvalho Chehab --- mailimport | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'mailimport') diff --git a/mailimport b/mailimport index 889193ec7..c7e1bf80a 100755 --- a/mailimport +++ b/mailimport @@ -29,7 +29,7 @@ if [ "$TMPDIR" == "" ]; then fi if [ "$EDITOR" == "" ]; then - EDITOR=nano + EDITOR="nano -w" fi DIR=$TMPDIR/mailimport$$ @@ -127,8 +127,22 @@ apply_patch () { echo "*** ERROR at hg addremove" exit fi + # Commit the changed files - hg commit -u "$committer" -m "`cat $TMP2|grep -v "^#"`" `diffstat -p1 -l $next` $cur/linux/Documentation/video4linux/CARDLIST.* + CARDLIST="`hg status -n -m|grep ^CARDLIST. |cut -b 3-`" + FILES="" + for i in `diffstat -p1 -l $next`; do + FILES="$FILES `pwd`/$i" + done + + + if [ "$FILES" == "" ]; then + echo "*** ERROR nothing to commit" + cd $cur + exit + fi + + hg commit -u "$committer" -m "`cat $TMP2|grep -v "^#"`" $CARDLIST $FILES if [ "$?" != "0" ]; then echo "*** ERROR at hg commit" @@ -153,6 +167,12 @@ git-mailsplit $MBOX $DIR echo for i in $DIR/*; do + if [ "`diffstat -p1 -l $i`" == "" ]; then + echo "*** ERROR nothing to commit" + cd $cur + exit + fi + cat $i| git-mailinfo $DIR/msg $DIR/patch>$DIR/author cat $DIR/msg|grep -vi ^CC: >$DIR/msg2 -- cgit v1.2.3