From 17aa9f4a88596f3041a955baf37e559aa88a7ec2 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Fri, 20 Mar 2009 03:22:04 -0300 Subject: mailimport: Fix script when CARDLIST.foo is touched From: Mauro Carvalho Chehab Signed-off-by: Mauro Carvalho Chehab --- mailimport | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/mailimport b/mailimport index 94f0d53c4..0050a1ded 100755 --- a/mailimport +++ b/mailimport @@ -131,27 +131,33 @@ apply_patch () { if [ "$?" != "0" ]; then echo "*** ERROR at hg addremove" echo hg addremove `diffstat -p1 -l $next` + patch -s -t -p1 -l -R -d $pdir -i $next exit -1 fi # Commit the changed files CARDLIST="`hg status -n -m|grep CARDLIST.`" FILES="" + for i in $CARDLIST; do + FILES="$FILES $cur/$i" + done for i in `diffstat -p1 -l $next`; do FILES="$FILES `pwd`/$i" done if [ "$FILES" == "" ]; then echo "*** ERROR nothing to commit" + patch -s -t -p1 -l -R -d $pdir -i $next cd $cur - exit + exit -1 fi - hg commit -d "$date" -u "$committer" -m "`cat $TMP2|grep -v "^#"`" $CARDLIST $FILES + hg commit -d "$date" -u "$committer" -m "`cat $TMP2|grep -v "^#"`" $FILES if [ "$?" != "0" ]; then echo "*** ERROR at hg commit" - echo hg commit -d \"$date\" -u \"$committer\" -m "" $CARDLIST $FILES + echo hg commit -d \"$date\" -u \"$committer\" -m "" $FILES + patch -s -t -p1 -l -R -d $pdir -i $next cd $cur exit -1 fi -- cgit v1.2.3