File indexing completed on 2024-11-17 05:08:37

0001 #!/bin/sh
0002 # Copyright (C) 2007 Matthias Kretz <kretz@kde.org>
0003 #
0004 # This program is free software; you can redistribute it and/or modify
0005 # it under the terms of the GNU General Public License version 2
0006 # as published by the Free Software Foundation.
0007 #
0008 # This program is distributed in the hope that it will be useful,
0009 # but WITHOUT ANY WARRANTY; without even the implied warranty of
0010 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0011 # GNU General Public License for more details.
0012 #
0013 # You should have received a copy of the GNU General Public License
0014 # along with this program; if not, write to the Free Software
0015 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
0016 # 02110-1301, USA.
0017 
0018 revertAndDiff() {
0019         cp -i "$1" "$1.tmp"
0020         svn revert "$1"
0021         mv -i "$1" "$1~"
0022         mv -i "$1.tmp" "$1"
0023         touch "$1" # so svn doesn't miss changes
0024         vimdiff "$1" "$1~"
0025         rm "$1~"
0026 }
0027 
0028 if test -z "$1"; then
0029         for i in `svn status|grep -v '^\?'|cut -c8-`; do
0030                 revertAndDiff "$i"
0031         done
0032 else
0033         revertAndDiff "$1"
0034 fi