changeset 3227:99ce5d097a09 beta

fixes for issue #731, update-repoinfo sometimes failed to update data when changesets were initial commits
author Marcin Kuzminski <marcin@python-works.com>
date Fri, 25 Jan 2013 16:42:02 +0100
parents 226013bac971
children ba2e2514a01a
files rhodecode/model/db.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/model/db.py	Fri Jan 25 02:33:52 2013 +0100
+++ b/rhodecode/model/db.py	Fri Jan 25 16:42:02 2013 +0100
@@ -1003,7 +1003,9 @@
         if isinstance(cs_cache, BaseChangeset):
             cs_cache = cs_cache.__json__()
 
-        if cs_cache != self.changeset_cache:
+        if (cs_cache != self.changeset_cache
+            or not self.last_change
+            or not self.changeset_cache):
             _default = datetime.datetime.fromtimestamp(0)
             last_change = cs_cache.get('date') or self.last_change or _default
             log.debug('updated repo %s with new cs cache %s' % (self, cs_cache))
@@ -1011,6 +1013,8 @@
             self.changeset_cache = cs_cache
             Session().add(self)
             Session().commit()
+        else:
+            log.debug('Skipping repo:%s already with latest changes' % self)
 
     @property
     def tip(self):