summaryrefslogtreecommitdiff
path: root/mailimport
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2007-05-02 09:51:41 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-05-02 09:51:41 -0300
commit4150c636f12b5dffa698344e849da59765b827f7 (patch)
tree6f4e0b70b4bb3cb8ae656a9410bbf8b60b0e55dd /mailimport
parentd4618eb817e012165cb72169eb3649e9c9ea7eb8 (diff)
downloadmediapointer-dvb-s2-4150c636f12b5dffa698344e849da59765b827f7.tar.gz
mediapointer-dvb-s2-4150c636f12b5dffa698344e849da59765b827f7.tar.bz2
Improvements at mailimport script
From: Mauro Carvalho Chehab <mchehab@infradead.org> - 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 <mchehab@infradead.org>
Diffstat (limited to 'mailimport')
-rwxr-xr-xmailimport24
1 files changed, 22 insertions, 2 deletions
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