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

Re: Feature request: Save the old file when svn revert

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Wed, 22 Jul 2015 11:42:59 +0000

Markus Schaber wrote on Tue, Jul 21, 2015 at 13:01:09 +0000:
> All other commands need a --force or other explicit user decision to
> override user changed data, but the whole purpose of the "svn revert"
> command is to undo local changes - putting a --force option or
> something similar seems like a bit of contradiction.

Note that 'svn revert' without further arguments does nothing and errors
out; you must name explicitly what will be reverted. (Even with '-R'
you still need to specify a target directory.)

> How do the other RCSes handle this situation? Maybe we can learn
> some ideas for a nice(r) UI there...

In Git, if you add a file to the index, you can generally 'cat-file
blob' it out of there for a while later if you know its hash (eg, if you
have the header of a diff of that file, as headers mention the hash).
Ditto for local commits, you can get them from the reflog for a while
later (until a garbage collection pass).

> On the other hand, I'm not an SVN core developer, so it's just my
> personal opinion.

For svn we could certainly stash the local filecontents in the pristine
store. They'd have refcount of zero so the next cleanup pass will
delete them. Storing them this way is not free (it costs disk space, so
for example people using 'revert' often will experience a behaviour
change). And if we do this, we'll have to think of the interface for
retrieving files from there.

So, I'm not sure whether we want to do this, and what the interface
might look like, but if we chooes to do this, the pristine store might
be an element of the solution.

Cheers,

Daniei
Received on 2015-07-22 13:43:12 CEST

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.