a/ForgeWiki/forgewiki/model/wiki.py b/ForgeWiki/forgewiki/model/wiki.py
1
from pylons import g #g is a namespace for globally accessable app helpers
1
from pylons import g #g is a namespace for globally accessable app helpers
2
from pylons import c as context
2
from pylons import c as context
3
3
4
from ming import schema
4
from ming import schema
5
from ming.orm import FieldProperty, ForeignIdProperty, Mapper
5
from ming.orm import FieldProperty, ForeignIdProperty, Mapper, session
6
from ming.orm.declarative import MappedClass
6
from ming.orm.declarative import MappedClass
7
7
8
from allura.model import VersionedArtifact, Snapshot, Feed, Thread, Post, User, BaseAttachment
8
from allura.model import VersionedArtifact, Snapshot, Feed, Thread, Post, User, BaseAttachment
9
from allura.model import Notification, project_orm_session
9
from allura.model import Notification, project_orm_session
10
from allura.lib import helpers as h
10
from allura.lib import helpers as h
...
...
77
    type_s = 'Wiki'
77
    type_s = 'Wiki'
78
78
79
    def commit(self):
79
    def commit(self):
80
        self.subscribe()
80
        self.subscribe()
81
        VersionedArtifact.commit(self)
81
        VersionedArtifact.commit(self)
82
        session(self).flush()
82
        if self.version > 1:
83
        if self.version > 1:
83
            v1 = self.get_version(self.version-1)
84
            v1 = self.get_version(self.version-1)
84
            v2 = self
85
            v2 = self
85
            la = [ line + '\n'  for line in v1.text.splitlines() ]
86
            la = [ line + '\n'  for line in v1.text.splitlines() ]
86
            lb = [ line + '\n'  for line in v2.text.splitlines() ]
87
            lb = [ line + '\n'  for line in v2.text.splitlines() ]