versioning bug fix: always use the master's name as base name for a new version
git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@1677 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
parent
a1d73273ee
commit
5acee802e0
2 changed files with 10 additions and 3 deletions
|
@ -90,6 +90,13 @@ a major version change, the lower levels are reset to 1:
|
||||||
>>> getName(d001v2_1)
|
>>> getName(d001v2_1)
|
||||||
u'd001_2.1.txt'
|
u'd001_2.1.txt'
|
||||||
|
|
||||||
|
The name of the new version is always derived from the name of the master
|
||||||
|
even if we create a new version from another one:
|
||||||
|
|
||||||
|
>>> d001v2_2 = IVersionable(d001v1_2).createVersion()
|
||||||
|
>>> getName(d001v2_2)
|
||||||
|
u'd001_2.2.txt'
|
||||||
|
|
||||||
|
|
||||||
Providing the Correct Version
|
Providing the Correct Version
|
||||||
=============================
|
=============================
|
||||||
|
@ -105,10 +112,10 @@ The default version is always the released or - if this is not available -
|
||||||
the current version (i.e. the version created most recently):
|
the current version (i.e. the version created most recently):
|
||||||
|
|
||||||
>>> IVersionable(getVersion(d001, TestRequest())).versionId
|
>>> IVersionable(getVersion(d001, TestRequest())).versionId
|
||||||
'2.1'
|
'2.2'
|
||||||
|
|
||||||
>>> IVersionable(getVersion(d001v1_2, TestRequest())).versionId
|
>>> IVersionable(getVersion(d001v1_2, TestRequest())).versionId
|
||||||
'2.1'
|
'2.2'
|
||||||
|
|
||||||
>>> d002 = resources['d002.txt']
|
>>> d002 = resources['d002.txt']
|
||||||
>>> IVersionable(getVersion(d002, TestRequest())).versionId
|
>>> IVersionable(getVersion(d002, TestRequest())).versionId
|
||||||
|
|
|
@ -135,7 +135,7 @@ class VersionableResource(object):
|
||||||
versionableObj.setVersioningAttribute('comment', comment)
|
versionableObj.setVersioningAttribute('comment', comment)
|
||||||
# generate name for new object, register in parent
|
# generate name for new object, register in parent
|
||||||
versionId = versionableObj.versionId
|
versionId = versionableObj.versionId
|
||||||
name = self.generateName(getName(context),
|
name = self.generateName(getName(self.master),
|
||||||
extensions.get(context.contentType, ''),
|
extensions.get(context.contentType, ''),
|
||||||
versionId)
|
versionId)
|
||||||
getParent(context)[name] = obj
|
getParent(context)[name] = obj
|
||||||
|
|
Loading…
Add table
Reference in a new issue