subversion-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Johnson <>
Subject Re: Feature request: Save the old file when svn revert
Date Tue, 21 Jul 2015 16:26:17 GMT
Seems to me that stashing the before-reverted copies could go into some
"recycle bin" / "trash" folder underneath the .svn folder at the root of
the working copy. And by default, the client could clean out files
time-stamped over a month old, so it doesn't perpetually grow. Cleanup
could happen on "commit" operations.

Then a new options could be added to the svn revert command. I'm thinking:
 - revert --undo path/to-local/file # undoes the revert
 - revert --list-undoable # lists all the available files with a revert
that can be undone

This has the advantages of not changing the existing semantics of the
revert operation, doesn't clutter up the directories of the working copy,
and self-cleans.


On Tue, Jul 21, 2015 at 9:14 AM, Andreas Mohr <> wrote:

> On Tue, Jul 21, 2015 at 11:06:06AM +0200, OBones wrote:
> > Grierson, David wrote:
> > >I completely understand that the action of sending to the Recycle Bin
> (in TortoiseSVN) is very system specific.
> > >
> > >To simply rename the item being reverted as $item.$backupSuffix before
> then restoring the pristine item is presumably not that system specific?
> > >
> > >Having this functionality in the base tool would then provide a benefit
> to all users and not just those using a specific IDE.
> > I would very much prefer if this could be an option that is not enabled
> by
> > default. I mean, this would clutter the filesystem with many files that
> one
> > would have to delete manually, especially when considering that some of
> us
> > are using less than optimal filesystems when it comes down to lots of
> small
> > files.
> This seems to hint that the revert-backup item
> possibly should *not* be placed in the same directory as the item,
> but rather in an "alternate tree base"
> (creating random similarly-named files next to each other in unexpected
> ways
> seems just asking for trouble,
> and lots of it - think build system mechanisms, other automatic
> handling, ...).
> Knee-jerk sample (hard-coded, non-elegant, read: day-to-day occurrence ;):
> unit_test1.c
> unit_test2.c
> unit_test1.c.revert_backup
> "cp -a unit_test* some_dir/"
> "some_dir/tool unit_test*"
> One might even implement this as a config option ("revert tree base
> directory"),
> and if left unspecified/empty
> svn could fall back to having .reverted files local,
> or another mode might be to record this within the local .svn dirs.
> Andreas Mohr
> --
> GNU/Linux. It's not the software that's free, it's you.

View raw message