Commits

Anonymous committed 0260960

be more careful about commit/rollback on the store

Comments (0)

Files changed (2)

ordf/handler/rdf.py

         ident = get_identifier(k)
         orig = Graph(self.store, identifier=ident)
         new = Graph(identifier=ident)
-        for statement in orig.triples((None, None, None)):
-            new.add(statement)
+        new += orig
+        orig.rollback()
         return new
     def __setitem__(self, k, g):
         assert isinstance(g, _Graph)
         old.remove((None, None, None))
         for statement in g.triples((None, None, None)):
             old.add(statement)
-        self.store.commit()
+        old.commit()
         if hasattr(self.store, "sync"):
             self.store.sync()
     def __delitem__(self, k):
         old = Graph(self.store, identifier=get_identifier(k))
         old.remove((None, None, None))
-        self.store.commit()
+        old.commit()
         if hasattr(self.store, "sync"):
             self.store.sync()
 
     def append(self, g):
         old = Graph(self.store, identifier=g.identifier)
         old += g
+        old.commit()
         if hasattr(self.store, "sync"):
             self.store.sync()
                                     
 from setuptools import setup, find_packages
 import sys, os
 
-version = '0.26'
+version = '0.27'
 
 try:
     from mercurial import ui, hg, error