Rockbox Technical Forums

Rockbox Development => Starting Development and Compiling => Topic started by: major_works on January 08, 2008, 10:14:04 PM

Title: Reverting to clean SVN
Post by: major_works on January 08, 2008, 10:14:04 PM
They say the only dumb questions are the ones you don't ask,  aso here goes:

Say I've checked out the current revision of SVN and then apply a bunch of patches. Something goes awry, though, and I want to revert my local repository to its original state.

How do I apply the revert command in Cygwin to do this?
Title: Re: Reverting to clean SVN
Post by: cool_walking_ on January 09, 2008, 01:49:13 AM
I never use the CLI for SVN, but it looks like "svn revert -R *" in the rockbox trunk directory should do it.

You might want to look into TortoiseSVN.
Title: Re: Reverting to clean SVN
Post by: GodEater on January 09, 2008, 03:31:08 AM
I never use the CLI for SVN, but it looks like "svn revert -R *" in the rockbox trunk directory should do it.

Nearly right :)

"svn revert -R ."
Title: Re: Reverting to clean SVN
Post by: linuxstb on January 09, 2008, 06:30:34 AM
One thing you need to be aware of is that "svn revert" will only touch files that are part of SVN.  This means that if your patches have created new files, then those new files will be unknown to SVN, and hence still sitting on your disk.

This can cause problems if you try to apply the patch again.

The only solution I know is to type "svn status" to see files listed with a ?, and manually delete them.  I normally do that separately within the "apps" and "firmware" directories.
Title: Re: Reverting to clean SVN
Post by: cool_walking_ on January 09, 2008, 07:01:46 AM
"svn clean" seemed like a natural name for that, so I googled it, and...

http://svn.collab.net/repos/svn/trunk/contrib/client-side/svn-clean

I'm assuming it actually works and isn't a work in progress since it says Copyright 2004.
Title: Re: Reverting to clean SVN
Post by: Mad Cow on January 09, 2008, 10:42:22 PM
I do it another way. I keep a clean copy of the source in another dir and just replace whatever files I need to revert, I have a big hard drive so it's not an issue keeping 2 copies of the source.
Title: Re: Reverting to clean SVN
Post by: dionoea on January 10, 2008, 09:59:55 AM
I do it another way. I keep a clean copy of the source in another dir and just replace whatever files I need to revert, I have a big hard drive so it's not an issue keeping 2 copies of the source.

Then you're in fact keeping 4 copies of each file on your disk, since svn already saves the "clean" version in the .svn directory (so it can run svn diff without having to ask the server). (Just my 2 cents...)
Title: Re: Reverting to clean SVN
Post by: Mad Cow on January 10, 2008, 04:15:04 PM
SVN reverting never worked right for me, so I just did it that way. It works and I don't care if it takes up alot of space.
Title: Re: Reverting to clean SVN
Post by: major_works on January 12, 2008, 09:54:11 PM
"svn clean" seemed like a natural name for that, so I googled it, and...

http://svn.collab.net/repos/svn/trunk/contrib/client-side/svn-clean

I'm assuming it actually works and isn't a work in progress since it says Copyright 2004.

OK, next dumb question(s):

Where should this program reside? The top line says:

#!/usr/bin/perl

Is that the directory in which I should place it? Would I simply invoke it from the command line with "svn clean?"
Title: Re: Reverting to clean SVN
Post by: Llorean on January 12, 2008, 09:57:17 PM
A #! means "run this script using this program". It tells your shell how to interpret it basically. When you run the script, it'll automatically run using perl rather than a default. That shouldn't affect where you put the script.
Title: Re: Reverting to clean SVN
Post by: major_works on January 12, 2008, 10:12:22 PM
A #! means "run this script using this program". It tells your shell how to interpret it basically. When you run the script, it'll automatically run using perl rather than a default. That shouldn't affect where you put the script.

OK, thanks. Was I correct, though, in surmising that it'd be invoked with "svn clean?"
Title: Re: Reverting to clean SVN
Post by: Llorean on January 12, 2008, 10:14:29 PM
Nah, you're actually executing the script. If it's in your path, it'd be svn-clean, if you put it in the folder you want to use it in, it'd be ./svn-clean from within that folder. At least, I think. I haven't actually *read* the script. :)