summaryrefslogtreecommitdiff
path: root/mailimport
diff options
context:
space:
mode:
Diffstat (limited to 'mailimport')
-rwxr-xr-xmailimport40
1 files changed, 35 insertions, 5 deletions
diff --git a/mailimport b/mailimport
index 2bcd2a09f..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$$
@@ -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`
@@ -125,8 +127,23 @@ 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`
+ 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"
cd $cur
@@ -137,12 +154,25 @@ apply_patch () {
hg log -r -1 -v
}
-echo git-mailsplit $MBOX $DIR
+grep -v $MBOX >$DIR/tmpbox <<EOF
+^Content-Type:
+^--Boundary-
+^Content-Disposition: inline
+^Content-Transfer-Encoding: 8bit
+EOF
+
+echo git-mailsplit $MBOX/tmpbox $DIR
echo -n "Number of patches at file: "
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