[[[
originally, asvn uses find commands to determine the files where
properties are set. The new version uses svn status. Therefore only
files that are part of the repository are used. This reduces warning
messages.

* contrib/client-side/asvn
  (recordpermissions): uses the new function svn_list instead of find

patch by joerg.steffens < at > dass-it.de
]]]

Index: contrib/client-side/asvn
===================================================================
--- contrib/client-side/asvn	(Revision 941370)
+++ contrib/client-side/asvn	(Arbeitskopie)
@@ -61,6 +63,24 @@
     rm -f $TMPFILE $TMPFILE1 $TMPFILE2
 }
 
+function stat_details()
+{
+    # attention: stat uses other variables as find, eg. %u<->%U
+    local path=${1:-.}
+    stat -c "mode=%a user=%U(%u) group=%G(%g)" "$path"
+}
+
+function svn_list()
+{
+    [ $# -eq 0 ] && local path="`pwd`"
+    # grep -v "^?": exclude all files that do not belong to subversion
+    # cut -c 42-: svn status lists different information. The filename starts at column 42
+    #   improvement: use "svn status --xml" and parse the xml output
+    svn status -v --ignore-externals $path "$@" | grep -v "^?" | cut -c 42-
+}
+
+
+
 function basedirname()
 {
     refname="$1"
@@ -320,10 +346,12 @@
     # Find all the directories and files
     cp /dev/null $TMPFILE
 
-    eval "find $PCWD $SKIPSVN -o \( \( -type d ! -name .svn  \) -o -type f \) $PRINTDETAILS" | while read info
+    # uses svn_list instead of version based on find,
+    # because the find version produces warnings for all files
+    # that are not part of the repository (eg. backup files)
+    svn_list $PCWD | while read device
     do
-        device=`expr "$info" : "file='\(.*\)' mode"`
-        info=`expr "$info" : "file='.*' \(mode.*\)"`
+        info=`stat_details "$device"`
 
         if [ "$PCWD" = "$device" ]
         then

Reply via email to