[Checkins] SVN: z3c.vcsync/trunk/ * Depend on ``zope.container`` instead of ``zope.app.container`` by depending on Grok 1.1 package versions.
Michael Howitz
mh at gocept.com
Mon Nov 1 03:46:21 EDT 2010
Log message for revision 118047:
* Depend on ``zope.container`` instead of ``zope.app.container`` by depending on Grok 1.1 package versions.
Changed:
U z3c.vcsync/trunk/CHANGES.txt
U z3c.vcsync/trunk/buildout.cfg
U z3c.vcsync/trunk/setup.py
U z3c.vcsync/trunk/src/z3c/vcsync/importexport.py
U z3c.vcsync/trunk/src/z3c/vcsync/tests.py
U z3c.vcsync/trunk/src/z3c/vcsync/vc.py
-=-
Modified: z3c.vcsync/trunk/CHANGES.txt
===================================================================
--- z3c.vcsync/trunk/CHANGES.txt 2010-11-01 07:33:59 UTC (rev 118046)
+++ z3c.vcsync/trunk/CHANGES.txt 2010-11-01 07:46:21 UTC (rev 118047)
@@ -1,3 +1,9 @@
+Issues
+======
+
+* Conflict resolution does not work with Subversion 1.6 (Tests fail, too).
+
+
z3c.vcsync changes
==================
@@ -4,14 +10,15 @@
0.18 (unreleased)
-----------------
-- Nothing changed yet.
+* Depend on ``zope.container`` instead of ``zope.app.container`` by
+ depending on Grok 1.1 package versions.
0.17 (2009-06-05)
-----------------
* Depend only on ``grokcore.component`` and ``zope.app.container``
- directly, not on ``grok`` itself. We want instead to depend only
+ directly, not on ``grok`` itself. We want instead to depend only
on ``zope.container``, but we cannot do this yet as we need
compatibility with Grok 0.14.
@@ -184,7 +191,7 @@
checkout. This has a significant drawback if the datetime setting of
the computer the synchronization code is running on is ahead of the
datetime setting of the version control server: updates could be
- lost.
+ lost.
Changed the code to use a revision_nr instead. This is a number that
increments with each synchronization, and the number can be used to
Modified: z3c.vcsync/trunk/buildout.cfg
===================================================================
--- z3c.vcsync/trunk/buildout.cfg 2010-11-01 07:33:59 UTC (rev 118046)
+++ z3c.vcsync/trunk/buildout.cfg 2010-11-01 07:46:21 UTC (rev 118047)
@@ -1,13 +1,11 @@
[buildout]
develop = .
parts = test devpython
-extends = http://grok.zope.org/releaseinfo/grok-0.14.cfg
+extends = http://grok.zope.org/releaseinfo/grok-1.1.cfg
versions = versions
-find-links = http://download.zope.org/distribution
[versions]
py = 0.9.1
-zope.testing =
[test]
recipe = zc.recipe.testrunner
Modified: z3c.vcsync/trunk/setup.py
===================================================================
--- z3c.vcsync/trunk/setup.py 2010-11-01 07:33:59 UTC (rev 118046)
+++ z3c.vcsync/trunk/setup.py 2010-11-01 07:46:21 UTC (rev 118047)
@@ -25,7 +25,7 @@
install_requires=[
'setuptools',
'grokcore.component',
- 'zope.app.container',
+ 'zope.container',
'py == 0.9.1',
],
license="ZPL 2.1",
Modified: z3c.vcsync/trunk/src/z3c/vcsync/importexport.py
===================================================================
--- z3c.vcsync/trunk/src/z3c/vcsync/importexport.py 2010-11-01 07:33:59 UTC (rev 118046)
+++ z3c.vcsync/trunk/src/z3c/vcsync/importexport.py 2010-11-01 07:46:21 UTC (rev 118047)
@@ -1,10 +1,10 @@
import py
import tempfile, zipfile
-from zope.app.container.interfaces import IContainer
+from zope.container.interfaces import IContainer
from z3c.vcsync.interfaces import IDump, IFactory
from zope.component import getUtility
-
+
def export(root, path):
for obj in root.values():
IDump(obj).save(path)
@@ -16,7 +16,7 @@
zf.writestr('data/', '')
_export_zip_helper(root, zf, 'data')
zf.close()
-
+
def _export_zip_helper(root, zf, save_path):
for obj in root.values():
name, bytes = IDump(obj).save_bytes()
@@ -26,12 +26,12 @@
sub_path = name
sub_path = sub_path.encode('cp437')
if IContainer.providedBy(obj):
- # create a directory
+ # create a directory
zf.writestr(sub_path + '/', '')
_export_zip_helper(obj, zf, sub_path)
else:
zf.writestr(sub_path, bytes)
-
+
def import_(root, path, modified_function=None):
modified_objects = _import_helper(root, path)
if modified_function is not None:
Modified: z3c.vcsync/trunk/src/z3c/vcsync/tests.py
===================================================================
--- z3c.vcsync/trunk/src/z3c/vcsync/tests.py 2010-11-01 07:33:59 UTC (rev 118046)
+++ z3c.vcsync/trunk/src/z3c/vcsync/tests.py 2010-11-01 07:46:21 UTC (rev 118047)
@@ -9,7 +9,7 @@
from zope import component
from zope.interface import implements, Interface
-from zope.app.container.interfaces import IContainer
+from zope.container.interfaces import IContainer
from zope.exceptions.interfaces import DuplicationError
from z3c.vcsync.interfaces import (ISerializer, IDump, IFactory, IParser,
@@ -18,14 +18,14 @@
class TestCheckout(object):
grok.implements(ICheckout)
-
+
def __init__(self, path):
self.path = path
self.update_function = None
self._files = []
self._removed = []
self._revision_nr = 0
-
+
def up(self):
# call update_function which will modify the checkout as might
# happen in a version control update. Function should be set before
@@ -47,9 +47,9 @@
def revision_nr(self):
return self._revision_nr
-
+
class TestAllState(vc.AllState):
-
+
def __init__(self, root):
super(TestAllState, self).__init__(root)
self.removed_paths = []
@@ -85,7 +85,7 @@
def _readonly(self):
pass
payload2 = property(_readonly)
-
+
class SubItem2(BaseItem):
def __init__(self, payload2):
self.payload2 = payload2
@@ -100,7 +100,7 @@
def _readonly(self):
pass
payload = property(_readonly)
-
+
class TestState(object):
implements(IState)
def __init__(self, root):
@@ -155,7 +155,7 @@
f.write('\n')
def name(self):
return self.context.__name__ + '.test2'
-
+
class ItemParser(grok.GlobalUtility):
grok.provides(IParser)
grok.name('.test')
@@ -193,7 +193,7 @@
class Container(object):
implements(IContainer)
-
+
def __init__(self):
self.__name__ = None
self.__parent__ = None
@@ -207,14 +207,14 @@
def __contains__(self, name):
return name in self.keys()
-
+
def __setitem__(self, name, value):
if name in self._data:
raise DuplicationError
self._data[name] = value
value.__name__ = name
value.__parent__ = self
-
+
def __getitem__(self, name):
return self._data[name]
@@ -223,7 +223,7 @@
return self[key]
except KeyError:
return default
-
+
def __delitem__(self, name):
del self._data[name]
@@ -244,7 +244,7 @@
"""Create an empty SVN repository.
Based on an internal testing function of the py library.
- """
+ """
repo = py.test.ensuretemp('testrepo' + postfix)
wcdir = py.test.ensuretemp('wc' + postfix)
if not repo.listdir():
Modified: z3c.vcsync/trunk/src/z3c/vcsync/vc.py
===================================================================
--- z3c.vcsync/trunk/src/z3c/vcsync/vc.py 2010-11-01 07:33:59 UTC (rev 118046)
+++ z3c.vcsync/trunk/src/z3c/vcsync/vc.py 2010-11-01 07:46:21 UTC (rev 118047)
@@ -5,7 +5,7 @@
from zope.interface import Interface
from zope.component import queryUtility, getUtility, queryAdapter
-from zope.app.container.interfaces import IContainer
+from zope.container.interfaces import IContainer
from zope.traversing.interfaces import IPhysicallyLocatable
from z3c.vcsync.interfaces import (IDump, ISerializer, IParser,
@@ -43,14 +43,14 @@
class ContainerDump(grok.Adapter):
grok.provides(IDump)
grok.context(IContainer)
-
+
def save(self, path):
path = path.join(self.context.__name__)
path.ensure(dir=True)
def save_bytes(self):
return self.context.__name__, ''
-
+
def resolve(root, root_path, path):
"""Resolve checkout path to obj in state.
@@ -149,7 +149,7 @@
# we retrieve the revision number to which we just synchronized
revision_nr = self.checkout.revision_nr()
-
+
# we store the new revision number in the state
self.state.set_revision_nr(revision_nr)
# and we return some information about what happened
@@ -173,13 +173,13 @@
object_paths_changed = [get_object_path(root, obj) for obj in
objects_changed]
return objects_changed, object_paths_changed, object_paths_removed
-
+
def save(self, revision_nr):
"""Save objects to filesystem.
"""
objects_changed, object_paths_changed, object_paths_removed =\
self._get_changed_removed(revision_nr)
-
+
# remove all files that have been removed in the database
path = self.checkout.path
for removed_path in object_paths_removed:
@@ -214,7 +214,7 @@
for obj in objects_changed:
if obj is not root:
IDump(obj).save(self._get_container_path(root, obj))
-
+
def load(self, revision_nr):
# remove all objects that have been removed in the checkout
root = self.state.root
@@ -247,7 +247,7 @@
# we always use the factory to create an item
factory = getUtility(IFactory, name=ext)
created = factory(file_path)
-
+
# we observe the stored item in the container
stored = container.get(name, None)
@@ -266,7 +266,7 @@
container[name] = created
modified_objects.append(container[name])
return modified_objects
-
+
def _get_container_path(self, root, obj):
steps = []
assert root is not obj, "No container exists for the root"
@@ -279,7 +279,7 @@
class AllState(object):
"""Report all state as changed.
-
+
It reports all objects in the state as modified, and reports nothing
removed. It actually completely ignores revision numbers. This
implementation is not something you'd typically want to use in your
@@ -295,7 +295,7 @@
def get_revision_nr(self):
return 0
-
+
def objects(self, revision_nr):
for container in self._containers():
for item in container.values():
@@ -305,7 +305,7 @@
def removed(self, revision_nr):
return []
-
+
def _containers(self):
return self._containers_helper(self.root)
@@ -335,21 +335,21 @@
The paths are state internal paths.
"""
return self._objects_removed
-
+
def objects_changed(self):
"""Paths of objects added or changed in synchronization.
The paths are state internal paths.
"""
return self._objects_changed
-
+
def files_removed(self):
"""Paths of files removed in synchronization.
The paths are filesystem paths (py.path objects)
"""
return self._files_removed
-
+
def files_changed(self):
"""The paths of files added or changed in synchronization.
More information about the checkins
mailing list