Skip to content

Commit b7ca074

Browse files
author
jef
committed
update indentation script
git-svn-id: http://svn.osgeo.org/qgis/trunk@12175 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent c1676d5 commit b7ca074

File tree

1 file changed

+27
-4
lines changed

1 file changed

+27
-4
lines changed

scripts/update-indent.sh

+27-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,21 @@ if ! type -p colordiff >/dev/null; then
88
}
99
fi
1010

11+
if ! type -p flip >/dev/null; then
12+
echo flip not found
13+
exit 1
14+
fi
15+
1116
set -e
1217

1318
# determine last commit
14-
REV0=$(svn info | sed -ne "s/Revision: //p")
19+
if [ -f .lastcommit ]; then
20+
REV0=$(<.lastcommit)
21+
svn revert -R .
22+
svn update -r$REV0
23+
else
24+
REV0=$(svn info | sed -ne "s/Revision: //p")
25+
fi
1526

1627
# update
1728
MODIFIED=$(svn update | sed -ne "s/^[^ ]* *//p")
@@ -30,11 +41,22 @@ ASTYLEDIFF=astyle.r$REV0-r$REV1.diff
3041
# reformat
3142
for f in $MODIFIED; do
3243
case "$f" in
44+
src/core/spatialite/*)
45+
echo $f skipped
46+
continue
47+
;;
48+
3349
*.cpp|*.h|*.c|*.h|*.cxx|*.hxx|*.c++|*.h++|*.cc|*.hh|*.C|*.H)
50+
cmd=astyle.sh
3451
;;
3552

53+
*.ui|*.qgm|*.txt|*.t2t|*.py|*.sip|resources/context_help/*)
54+
cmd="flip -ub"
55+
;;
56+
3657
*)
37-
continue
58+
echo $f skipped
59+
continue
3860
;;
3961
esac
4062

@@ -46,7 +68,7 @@ for f in $MODIFIED; do
4668
m=$f.r$REV1.prepare
4769

4870
cp $f $m
49-
astyle.sh $f
71+
$cmd $f
5072
if diff -u $m $f >>$ASTYLEDIFF; then
5173
# no difference found
5274
rm $m
@@ -62,7 +84,8 @@ if [ -s "$ASTYLEDIFF" ]; then
6284
fi
6385

6486
# just echo for now
65-
echo svn commit -m "automatic indentation update (r$REV0-r$REV1)"
87+
echo "svn commit -m \"automatic indentation update (r$REV0-r$REV1)\""
88+
echo $REV1 >.lastcommit
6689
else
6790
echo "No indentation updates."
6891
rm $ASTYLEDIFF

0 commit comments

Comments
 (0)