Skip to main content

provides an archetypes storage which stores files on the filesystem into a mercurial repository

Project description

Introduction

raptus.mercurialstorage depends on Products.ExternalStorage 0.7 which has some flaws and needs to be patched in order to work correctly. The patch may be applied by using the following part in your buildout:

[patch_es_storage]
recipe = iw.recipe.cmd:py
on_install = true
on_update = true
cmds =
    >>> import os
    >>> patch = os.path.join("""${buildout:directory}""".strip(), 'eggs/raptus.mercurialstorage-0.4-py2.4.egg/raptus/mercurialstorage', 'es.patch')
    >>> file = os.path.join("""${buildout:directory}""".strip(), 'eggs/Products.ExternalStorage-0.7-py2.4.egg/Products/ExternalStorage/ExternalStorage.py')
    >>> if os.path.exists(file):
    >>>     os.system('patch -N %s %s' % (file, patch))

You also need mercurial working copies at the root of your storages so if you have a field on which you use an ExternalMercurialStorage with a prefix of foo make sure a folder with the name foo exists in your instances var folder and is initialized using ‘hg init’. If you are using buildout, there are two var folders, one in your buildout’s root and one at parts > instance, the aforementioned folder has to be created in the latter one.

All the mercurial commits are handled asynchronous using a queue, as a side effect the files saved to mercurial storage are not immediately visible in plone, in this case a attribute called ‘asynch’ is set on the content instance, which may be used to display an information message to the user. The mentioned queue is processed by a view named ‘processMercurialActionQueue’ which has to be called regularly by a user having the ‘Manage portal’ permission. It is suggested to use zope clock server to call this view about ever minute or more, add the following configuration to your instance part’s zope-conf-additional variable:

<clock-server>
  method [PATH_TO_YOUR_PLONE_SITE]@@processMercurialActionQueue
  period 60
  user [MANAGER_USERID]
  password [MANAGER_PWD]
  host localhost
</clock-server>

raptus.mercurialstorage logs to a different log file which is found in your log folder under the name mercurial.log.

Migration from pre 1.0b3

Products.ExternalStorage stores absolute file paths in the ZODB which makes moving existing plone instances a pain. This issue was fixed in version 1.0b3 of raptus.mercurialstorage. To migrate an existing plone site use the migrate script located in the scripts folder of the raptus.mercurialstorage egg. Information about the usage of the script are given by executing:

bin/instance run path_to_the_script -h

Changelog

1.0b5 (2014-11-20)

  • added dry run and remove path parameters to migration script

1.0b4 (2013-02-26)

  • improved hg execution (no PYTHONPATH modification anymore)

1.0b3 (2013-01-31)

  • major improvement to Products.ExternalStorage which now no longer stores absolute file paths (migration script added to fix existing plone sites)

1.0b2 (2010-09-08)

  • fixed queue (now checking lazy queue for new actions before processing)

  • adjusted download view to get the filename from the archetypes field rather than from the filesystem path

1.0a1 (2010-09-07)

  • improved queue processing (now using thread safe reentrant locks)

0.4 (2010-04-12)

  • fixed README.txt (adjusted patch file location)

  • fixed ReST format (README)

  • bugfix in recursiveDelete method which raised an exception in some cases and caused the action queue to hang

0.3 (2010-02-19)

  • bugfix in datamanager (no longer logs empty lines)

  • bugfix in queue (commit transaction after changing asynch flag)

0.2 (2010-02-19)

  • improved queue to compare appended action with previous ones and skipping them if needed

  • bugfix in datamanager (repo not found under linux)

0.1 (2009-10-30)

  • Initial release

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

raptus.mercurialstorage-1.0b5.zip (23.4 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page