You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by Erlend Birkenes <er...@birkenes.net> on 2008/08/14 02:32:56 UTC

A few useful bash scripts

Hi

I got tired of having to manually add any new files to svn after I apply a
patch so I wrote a little bash-script that does it automatically.
After I had done that I figured it would be nice to also do the opposite, so
I wrote one that deletes all unversioned files, and then
one that reverts and then deletes all unversioned files so it completely
removes the patch and you're left with a clean, pristine copy.

I'm not very good at this so it's not very fancy, but it works quite well
and maybe someone else will find it useful.

How to use:

Save the files somewhere on your path and make them executable

svnpatch <patch>
Must be run from the root-directory of the patch.
Will apply the patch with -p0 -i <patch>, and then add any new files to svn.
-----

svnclean
>From the root of the client, or
svnclean <directory>
from anywhere else

This will run 'svn stat' and delete any unversioned files. (Except the files
.project and .classpath and the folder .externalToolBuilders which is used
by Eclipse)
-----

svnrevert .
>From the root of the client (note the dot at the end), or
svnrevert <directory>
from anywhere else

Will run revert -R and then run svnclean to remove any unversioned files
left behind.
-----

Just make sure you don't have any unversioned files that you don't want to
delete!

I have used it a few times now and it works for me, and hopefully it will
for everyone.

I hope it's useful! Feel free to improve!


-Erlend

Re: A few useful bash scripts

Posted by "Dag H. Wanvik" <Da...@Sun.COM>.
Erlend Birkenes <er...@birkenes.net> writes:

> I'm not very good at this so it's not very fancy, but it works quite well
> and maybe someone else will find it useful.

In deed useful; I built very similar ones and use them all the time :)
I make my version of "svnpatch" register the patch name in a file
CURRPATCH, similarly when I make a patch in a workspace I have a
script "makepatch" which also updates the CURRPATCH file, allowing
tests that I run off the workspace to identify which patch was tested;
helps when you have several parallel workspaces.

Dag