Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

rurban (7989)

rurban
  {rurban} {at} {x-ray.at}
http://rurban.xarch.at/

cygwin maintainer for perl, parrot, clisp, postgresql, ... and some perl modules (perl-libwin32, perl-Win32-GUI). Has also some hairy CPAN packages: B::C, B::Generate, C::DynaLib, B::Debugger ...

Journal of rurban (7989)

Saturday January 03, 2009
11:04 AM

svn cleanup (parrot)

[ #38213 ]

From time to time I want a clean svn repo again, esp. for parrot.

Something like a make distclean if that would work in parrot.

I could delete all files which are not in MANIFEST, but easier is this simple svn hack, svn-cleanup :


#!/bin/sh
# remove unknown files
svn status|perl -ane'print "$F[1]\n" if /^\?/' |\
                      xargs rm
# AND revert modified files. take care!!!
for f in $(svn status | \
    perl -ane 'print "$F[1]\n" if /^\M/')
do
    svn revert $f
done

This deletes all files not in the repo and reverts all my private modifications.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Doesn't 'make svnclobber' and 'svn revert -R .' achieve the same goal?
    --
    /* Bernhard.Schmalhofer@gmx.de */
  • cd $root_of_working_copy
    rm -r .!(@(|.|git)) *
    git reset --hard

    • (This does assume bash with the extglob option set and failglob unset, btw; the latter is the default, the former I think is not.)

      • Thanks for the tip, but cloning the parrot repo with git svn did last about 24 hours. I wouldn't recommend that.

        • Ouch. Yeah, the Subversion protocol is very chatty and not designed with the idea in mind that someone would want to retrieve every single revision. I wonder what happened to the git-svnserver effort…