svn move multiple directories with confirm

I had to rearrange multiple directories, but not all, in a svn tree to make a project more compatible with Eclipse. For this I used the following one-liner so I could do this more easily.

for file in `find -maxdepth 1 -type d`; do \
echo -n $file "[y/n] "; \
read -n 1 shouldMove ; \
if [ "$shouldMove" == "y" ]; \
then \
svn mv `basename $file` WebContent/`basename $file`; \
fi; \
done

This way I was sure all directories I wanted to move were moved (since a svn mv does not remove the directory right away, it does that on commit).

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>