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

Revert should be recursive by default

From: <peter_at_pdavis.cx>
Date: 2003-01-21 07:39:47 CET

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I got burned today because revert is not recursive when used to recover a
deleted directory. The problem:

* I renamed a directory: $ svn mv foo bar

* I decided I didn't like the new name I had just given it.

* Since currently you can't copy or move something twice without
committing, I reverted both the copied and deleted directories:
  $ svn revert foo bar

* I renamed the directory again: $ svn mv foo baz

* I committed without realizing that although I had reverted foo, I had not
reverted the files within foo, which were still scheduled for deletion.

So, is there a good reason to not have revert be recursive? I can't
remember a time when I *ever* didn't use -R (except this time, when I
forgot). Can anyone think of a use-case for -N (and should it be the
default like it is today)? Could the same thing that was recently done
with add be done to revert (ie., swap the -R for -N)?

Also, I thought it was pretty funny when I saw D + baz/file from svn
st.

$ svnadmin create test-repo
$ svn co file://$(pwd)/test-repo test-wc
Checked out revision 0.
$ cd test-wc
$ svn mkdir foo
A foo
$ touch foo/file
$ svn add foo/file
A foo/file
$ svn ci -m add file
Adding foo
Adding foo/file
Transmitting file data .
Committed revision 1.
$ svn mv foo bar
A bar
D foo/file
D foo
$ svn st
A + bar
D foo
D foo/file
$ svn revert bar foo
Reverted bar
Reverted foo
$ svn st
? bar
D foo/file
$ rm -rf bar
$ svn mv foo baz
A baz
D foo/file
D foo
$ svn st
A + baz
D + baz/file
D foo
D foo/file
$ svn ci -m renamed foo
Adding baz
Deleting baz/file
Deleting foo
Committed revision 2.

Now baz/foo is gone! (Of course I can recover it by copying from an older
revision, but it's annoying.)

- --
Peter Davis
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+LOs1hDAgUT1yirARAv3pAJ4+PEDLpSxW9CDGwQEME/gbTwuwuACgiC+N
tJqXwMX50C0Dbzd1oNgtF3o=
=c4Wh
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 14 02:03:28 2006

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

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