aboutsummaryrefslogtreecommitdiff
path: root/rhodecode/model/db.py
diff options
context:
space:
mode:
authorMarcin Kuzminski <marcin@python-works.com>2013-01-25 16:42:02 +0100
committerMarcin Kuzminski <marcin@python-works.com>2013-01-25 16:42:02 +0100
commit685d36057444efd8c8fa85f5fac440449274d863 (patch)
tree290b5c955bb6a2c3ffa18151c3ee3697cb9ec80f /rhodecode/model/db.py
parent059e130371315a3d0ff08926d0713ed9881b3cf8 (diff)
fixes for issue #731, update-repoinfo sometimes failed to update data when changesets
were initial commits --HG-- branch : beta
Diffstat (limited to 'rhodecode/model/db.py')
-rwxr-xr-xrhodecode/model/db.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/rhodecode/model/db.py b/rhodecode/model/db.py
index eaf84223..1941e139 100755
--- a/rhodecode/model/db.py
+++ b/rhodecode/model/db.py
@@ -1003,7 +1003,9 @@ class Repository(Base, BaseModel):
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 @@ class Repository(Base, BaseModel):
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):