[dataimport] print transaction id when we get one stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 31 Mar 2010 10:56:43 +0200
branchstable
changeset 5097 60a237638f57
parent 5096 e25979a6d795
child 5098 32b1adfb6b92
[dataimport] print transaction id when we get one
dataimport.py
--- a/dataimport.py	Wed Mar 31 09:58:44 2010 +0200
+++ b/dataimport.py	Wed Mar 31 10:56:43 2010 +0200
@@ -498,7 +498,7 @@
                     err = func(buckets)
                     if err:
                         self.errors[title] = (help, err)
-        self.store.commit()
+        txuuid = self.store.commit()
         self._print_stats()
         if self.errors:
             if self.askerror == 2 or (self.askerror and confirm('Display errors ?')):
@@ -506,7 +506,8 @@
                 for errkey, error in self.errors.items():
                     self.tell("\n%s (%s): %d\n" % (error[0], errkey, len(error[1])))
                     self.tell(pformat(sorted(error[1])))
-
+        if txuuid is not None:
+            print 'transaction id:', txuuid
     def _print_stats(self):
         nberrors = sum(len(err[1]) for err in self.errors.values())
         self.tell('\nImport statistics: %i entities, %i types, %i relations and %i errors'