[Pkg-owncloud-commits] [owncloud] 164/394: backport of pull request #691, no file versions if fs cache

David Prévot taffit at alioth.debian.org
Fri Nov 8 23:11:54 UTC 2013


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to annotated tag v4.5.10
in repository owncloud.

commit 85382a51401f9d4c91bfef5cbefa22b6d0062617
Author: Björn Schießle <schiessle at owncloud.com>
Date:   Fri Nov 30 16:51:39 2012 +0100

    backport of pull request #691, no file versions if fs cache
---
 lib/filesystemview.php |   26 ++++++++++++++++++++++++--
 1 file changed, 24 insertions(+), 2 deletions(-)

diff --git a/lib/filesystemview.php b/lib/filesystemview.php
index fa8191c..7dde0f7 100644
--- a/lib/filesystemview.php
+++ b/lib/filesystemview.php
@@ -431,6 +431,9 @@ class OC_FilesystemView {
 					$result = OC_Helper::streamCopy($source, $target);
 				}
 				if( $this->fakeRoot==OC_Filesystem::getRoot() ){
+					// If the file to be copied originates within
+					// the user's data directory
+					
 					OC_Hook::emit(
 						OC_Filesystem::CLASSNAME,
 						OC_Filesystem::signal_post_copy,
@@ -451,9 +454,28 @@ class OC_FilesystemView {
 						OC_Filesystem::signal_post_write,
 						array( OC_Filesystem::signal_param_path => $path2)
 					);
-				} else { // no real copy, file comes from somewhere else, e.g. version rollback -> just update the file cache and the webdav properties without all the other post_write actions
-					OC_FileCache_Update::update($path2, $this->fakeRoot);
+				} else { 
+				// If this is not a normal file copy operation 
+				// and the file originates somewhere else 
+				// (e.g. a version rollback operation), do not 
+				// perform all the other post_write actions
+					
+					// Update webdav properties
 					OC_Filesystem::removeETagHook(array("path" => $path2), $this->fakeRoot);
+					
+					$splitPath2 = explode( '/', $path2 );
+					
+					// Only cache information about files 
+					// that are being copied from within 
+					// the user files directory. Caching 
+					// other files, like VCS backup files,
+					// serves no purpose
+					if ( $splitPath2[1] == 'files' ) {
+						
+						OC_FileCache_Update::update($path2, $this->fakeRoot);
+						
+					}
+				
 				}
 				return $result;
 			}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list