From: Björn Schießle Date: Wed, 8 May 2013 14:32:29 +0000 (+0200) Subject: rename a file if it gets restored so that it no longer exists as a version. Otherwise... X-Git-Tag: v6.0.0alpha2~791 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=bda8187f3b305d0d1d7843bb9eaf0074ae5009d4;p=nextcloud-server.git rename a file if it gets restored so that it no longer exists as a version. Otherwise it can happen that the expire() function removes all other versions so that we end up with only one version which is exactly the same as the original file --- diff --git a/apps/files_versions/lib/versions.php b/apps/files_versions/lib/versions.php index 836e3914dc0..5fdbef27743 100644 --- a/apps/files_versions/lib/versions.php +++ b/apps/files_versions/lib/versions.php @@ -200,7 +200,7 @@ class Storage { } // rollback - if( @$users_view->copy('files_versions'.$filename.'.v'.$revision, 'files'.$filename) ) { + if( @$users_view->rename('files_versions'.$filename.'.v'.$revision, 'files'.$filename) ) { $files_view->touch($file, $revision); Storage::expire($file); return true;