How can I massively convert images saved as text / ascii in svn to binary?

Somehow the images were saved as text / ascii, and I need to do this recursively for hundreds of image directories, all under one root directory images.

I got a few instructions here that tell me:

svn proplist <yourfile>
svn propdel svn:eol-style <yourfile>
svn propset svn:mime-type application/octet-stream <yourfile>

Is there any own svn recursive method I can do this? If not, could someone advise how I could recursively apply this using a bash script?

+3
source share
3 answers

On the shell:

find -name '*.png' -exec \
sh -c "svn propdel svn:eol-style {} && svn propset svn:mime-type image/png {}" \;
+3
source

Subversion, , :

find . -name .svn -prune -o print

( .svn).

find . -name .svn -prune -o print | while read file
do
   svn propdel svn:eol-style $file
   svn propset svn:mime-type application/octet-stream $file
done

, , . . . , find:

find . -name .svn -prune -o -name "*.jpg" print

Subversion :

find . -name .svn -prune -o print | while read file
do
   echo svn propdel svn:eol-style $file
   echo svn propset svn:mime-type application/octet-stream $file
done

, echo .

+1

powershell , :

foreach( $file in get-childitem -name -include *.png -exclude .svn -recurse) {
    &  svn propdel svn:eol-style $file;
    & svn propset svn:mime-type image/png $file
};
+1

Source: https://habr.com/ru/post/1778807/


All Articles