Changeset - 99ce5d097a09
[Not reviewed]
beta
0 1 0
Marcin Kuzminski - 13 years ago 2013-01-25 16:42:02
marcin@python-works.com
fixes for issue #731, update-repoinfo sometimes failed to update data when changesets
were initial commits
1 file changed with 5 insertions and 1 deletions:
0 comments (0 inline, 0 general)
rhodecode/model/db.py
Show inline comments
 
@@ -1000,20 +1000,24 @@ class Repository(Base, BaseModel):
 
        from rhodecode.lib.vcs.backends.base import BaseChangeset
 
        if cs_cache is None:
 
            cs_cache = self.get_changeset()
 
        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))
 
            self.updated_on = last_change
 
            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):
 
        return self.get_changeset('tip')
 

	
 
    @property
0 comments (0 inline, 0 general)