owncloud/core — pull request #934 by schiesbn (2012-12-18 12:10:41+00:00)
Title: Smart handling of version history

After some discussion with @jancborchardt and @karlitschek last week we come up with a smart way to expire versions. See also https://github.com/owncloud/core/issues/860

This is a first implementation providing following features:

- switch from post_write hook to write hook to generate versions
- max. 50% of available disk space from the given user is used to store versions
- following rules are used to keep/expire versions:
- first hour: every 10 seconds one version is kept
- after first hour until end of first month: every hour one version is kept
- after first month we keep one version per day
- if the max space for versions is exceeded we delete the latest versions until we meet the limit or until only one version is left

This is just a initial version which allows us to to gather some experience with the limits. We can tune this values easily if we see that they need to be adjusted.