[Zope-CVS] SVN: zversioning/trunk/src/versioning/ listVersions now
works
Grégoire Weber
zope.org at incept.ch
Thu Oct 14 05:39:30 EDT 2004
Log message for revision 28150:
listVersions now works
Changed:
U zversioning/trunk/src/versioning/README.txt
U zversioning/trunk/src/versioning/interfaces.py
U zversioning/trunk/src/versioning/repository.py
U zversioning/trunk/src/versioning/storage.py
-=-
Modified: zversioning/trunk/src/versioning/README.txt
===================================================================
--- zversioning/trunk/src/versioning/README.txt 2004-10-14 08:57:45 UTC (rev 28149)
+++ zversioning/trunk/src/versioning/README.txt 2004-10-14 09:39:28 UTC (rev 28150)
@@ -182,12 +182,11 @@
We have a look if the version history grows with a checkin:
- #>>> len(repo.getVersionHistory(sample))
+ >>> len(repo.listVersions(sample))
1
>>> repo.checkout(sample)
>>> repo.text = 'text version 2 of sample'
>>> repo.checkin(sample)
- #>>> len(repo.getVersionHistory(sample))
+ >>> len(repo.listVersions(sample))
2
- >>>
\ No newline at end of file
Modified: zversioning/trunk/src/versioning/interfaces.py
===================================================================
--- zversioning/trunk/src/versioning/interfaces.py 2004-10-14 08:57:45 UTC (rev 28149)
+++ zversioning/trunk/src/versioning/interfaces.py 2004-10-14 09:39:28 UTC (rev 28150)
@@ -341,14 +341,8 @@
zope.app.annotation.interfaces.IAnnotatable):
"""Version control is allowed for objects that provide this."""
-class INonVersionable(zope.interface.Interface):
- """Version control is not allowed for objects that provide this.
-
- XXX Do we need that? Is this YAGNI?
- """
-
class IVersioned(IVersionable):
"""Version control is in effect for this object."""
-# XXX describe Event types here
+# XXX describe generated events here
Modified: zversioning/trunk/src/versioning/repository.py
===================================================================
--- zversioning/trunk/src/versioning/repository.py 2004-10-14 08:57:45 UTC (rev 28149)
+++ zversioning/trunk/src/versioning/repository.py 2004-10-14 09:39:28 UTC (rev 28150)
@@ -97,16 +97,16 @@
(obj, self.histories), interfaces.IVersionableAspects)
versionable_state.updateAspects(specifier)
+ def getTicket(self, obj):
+ return self.histories.getTicket(obj)
+
def getVersion(self, obj, selector):
return self.histories.getVersion(obj, selector)
- def getVersionHistory(self, obj):
- return self.histories.getVersionHistory(obj)
+ def listVersions(self, obj):
+ return self.histories.listVersions(obj)
- def getMetadataHistory(self, obj):
- return self.histories.getMetadataHistory(obj)
-
class CheckoutCheckinRepository(CopyModifyMergeRepository):
"""The repository handles simple linear histories.
"""
Modified: zversioning/trunk/src/versioning/storage.py
===================================================================
--- zversioning/trunk/src/versioning/storage.py 2004-10-14 08:57:45 UTC (rev 28149)
+++ zversioning/trunk/src/versioning/storage.py 2004-10-14 09:39:28 UTC (rev 28150)
@@ -107,10 +107,9 @@
def listVersions(self, obj) :
""" Returns the versions of an object. The versions are
returned sorted in the order of appearance. """
- list = self.history.values()
- list.sort()
- return list
-
+ history = list(self.getVersionHistory(obj).values())
+ history.sort(lambda l,r:cmp(l.__name__, r.__name__))
+ return history
class DefaultCheckoutAware(object):
More information about the Zope-CVS
mailing list