ossp-pkg/svs/svs.sh 1.8 -> 1.9
--- svs.sh 2005/08/18 07:46:14 1.8
+++ svs.sh 2005/10/03 10:33:48 1.9
@@ -117,18 +117,28 @@
if [ ! -f $edit ]; then
# special case: removed file
echo "Index: $edit"
- diff -u3 $orig /dev/null | sed -e "1s/^--- $orig/--- $edit/"
+ ( diff -U3 $orig /dev/null 2>/dev/null ||\
+ diff -u $orig /dev/null 2>/dev/null ||\
+ diff -C3 $orig /dev/null 2>/dev/null ||\
+ diff $orig /dev/null
+ ) | sed -e "1s/^--- $orig/--- $edit/"
elif [ ! -r $orig ] && [ ! -s $orig ]; then
# special case: new file
echo "Index: $edit"
- diff -u3 /dev/null $edit
+ diff -U3 /dev/null $edit 2>/dev/null ||\
+ diff -u /dev/null $edit 2>/dev/null ||\
+ diff -C3 /dev/null $edit 2>/dev/null ||\
+ diff /dev/null $edit
else
# regular case: edited file
if cmp $orig $edit >/dev/null 2>&1; then
:
else
echo "Index: $edit"
- diff -u3 $orig $edit
+ diff -U3 $orig $edit 2>/dev/null ||\
+ diff -u $orig $edit 2>/dev/null ||\
+ diff -C3 $orig $edit 2>/dev/null ||\
+ diff $orig $edit
fi
fi
done
|
|