hooks/metadata.py
branchstable
changeset 4578 060c91ced72f
parent 4307 7fba9c34c88f
child 4806 4f12f59b1a13
--- a/hooks/metadata.py	Mon Feb 15 15:14:27 2010 +0100
+++ b/hooks/metadata.py	Mon Feb 15 15:14:50 2010 +0100
@@ -55,7 +55,13 @@
     events = ('before_update_entity',)
 
     def __call__(self):
-        self.entity.setdefault('modification_date', datetime.now())
+        # repairing is true during c-c upgrade/shell and similar commands. We
+        # usually don't want to update modification date in such cases.
+        #
+        # XXX to be really clean, we should turn off modification_date update
+        # explicitly on each command where we do not want that behaviour.
+        if not self._cw.vreg.config.repairing:
+            self.entity.setdefault('modification_date', datetime.now())
 
 
 class _SetCreatorOp(hook.Operation):