[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: revert -keep?

From: Benjamin Pflugmann <benjamin-svn-usr_at_pflugmann.de>
Date: 2003-08-24 16:56:38 CEST

On Sat 2003-08-09 at 14:44:52 -0700, you wrote
> Ben Collins-Sussman wrote:
[...]
> >This use-case happens to us all the time in svn development. We're
> >working on a large change, and whoops, need to switch gears, so we put
> >the whole changeset aside:
> >
> > $ svn diff > mypatch
> > $ svn revert . -R
> > $ svn up
> > $ edit files, commit, etc.
> > $ patch -p0 < mypatch
> > ...then continue on where you left off.
> >
> >Your proposal seems much clunkier to me. You'd rather have 'svn
> >revert' leave a bunch of 'backup' files around your working
> >copy... and then later hand-move them back into place? :-/
> >
>
> Yeah, I would, disk space is cheap. I wasn't proposing making it the
> default however. If you don't approve, that's fine with me, but all you
> have to do right now is leave out the diff > mypatch, and it's alllll gone.

Then don't (mis-)use svn revert at all, but simply reverse-apply the patch:

  $ svn diff > mypatch
  $ patch -pX -R <mypatch
  $ svn up
  $ edit files, commit, etc.
  $ patch -p0 < mypatch
   ...then continue on where you left off.

(without looking I am not sure if -p0, -p1 or whatever is necessary.)

It may happen occasionlly that you made such big changes that you
still need to revert (if you did major restructuring of your tree),
but at least you have the major work on the save side.

> The 'Protection' afforded by requiring a parameter to revert is effectively
> useless in my mind.

Well, IMHO, using "svn revert" is similar to using "rm" with a pattern
or "-rf", i.e. be very careful about it and think twice before you
actually hit return.

Using revert for preparing a WC for an update kind of looks like using
"cp -a" and "rm -rf" instead of mv. Yes, sometimes you have to go this
way (e.g. moves across partitions), but then you should be double
careful about what you do.

Bye,

        Benjamin.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Mon Aug 25 16:57:30 2003

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.