#!/bin/bash # # svnlist.sh - helper app for listing only the files under svn management # Copyright (C) 2007 Clifford Wolf # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. x1=`mktemp` x2=`mktemp` svn st --no-ignore "$@" | grep '^[?ID]' | cut -c8- | sed 's,^ *,,' > $x1 find "$@" \! -wholename '*/.svn/*' \! -wholename '*/.svn' -type f | sed 's,^./,,' > $x2 gawk ' function add(filename) { testfn = filename "/"; while (gsub("/[^/]*$", "", testfn)) { if (ignore[testfn]) return; } files[filename] = 1; } ARGIND == 1 { ignore[$0] = 1; } ARGIND == 2 { add($0); } END { for (f in files) print f; } ' $x1 $x2 | sort rm -f $x1 $x2