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

Re: SV: Feature request: unrevert

From: Stefan Küng <tortoisesvn_at_gmail.com>
Date: 2006-10-18 19:04:00 CEST

km@dfa.com wrote:

> I haven't looked at how the revert API to the Subversion library works yet,
> but I have some thoughts on this problem.
> First, the "worst case scenario" is worse than what's referenced in that
> link. If the recycle bin is disabled, and the user tries to revert
> thinking that revert can undo a partial commit, then the files will be
> gone.
> Even if the only good place to invoke the recycle bin is from inside the
> Subversion library, I think that would be a bad place to put it. The
> recycle bin is a Windows Shell concept, and TortoiseSVN is a Windows Shell
> app. Command line tools, even in Windows, don't tend to use Shell
> extensions (for example, del doesn't have an option that says "send to
> recycle bin").

But command line tools can still use the SHFileOperation() API which
makes use of the recycle bin.

> Here's one way revert recycling can work:
> o User selects files to revert
> o Tortoise renames each file to a temporary name
> o SVN revert is called
> o If the revert fails, the renamed files are renamed back to their
> original names, overwriting any partial revert
> o If the revert succeeds, the new files are renamed to another temporary
> name. The original files are renamed to their original names and sent to
> the recycle bin. The new files are finally renamed back to their final
> names.

You're doing a *lot* of renames here. Which always means heavy disk
access, and disk access is slow. If you're dealing with big files (e.g.
large image files of several MB in size), you could slow down a revert
operation for several seconds.

But it's the best solution I've heard so far. Of course, if we really
want to do that. I'd rather not do that whole 'recycle bin' feature in TSVN.


   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.net
To unsubscribe, e-mail: dev-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: dev-help@tortoisesvn.tigris.org
Received on Wed Oct 18 19:04:45 2006

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