Changeset - 82fa5c6e958e
[Not reviewed]
default
0 1 0
Mads Kiilerich - 12 years ago 2013-12-10 19:30:37
madski@unity3d.com
status: don't calculate status of whole repo when given empty list

SQLAlchemy would warn that it was a bad idea.
1 file changed with 5 insertions and 4 deletions:
0 comments (0 inline, 0 general)
kallithea/model/db.py
Show inline comments
 
@@ -1362,18 +1362,19 @@ class Repository(Base, BaseModel):
 
            grouped[cmt.revision].append(cmt)
 
        return grouped
 

	
 
    def statuses(self, revisions=None):
 
    def statuses(self, revisions):
 
        """
 
        Returns statuses for this repository
 

	
 
        :param revisions: list of revisions to get statuses for
 
        """
 
        if not revisions:
 
            return {}
 

	
 
        statuses = ChangesetStatus.query()\
 
            .filter(ChangesetStatus.repo == self)\
 
            .filter(ChangesetStatus.version == 0)
 
        if revisions:
 
            statuses = statuses.filter(ChangesetStatus.revision.in_(revisions))
 
            .filter(ChangesetStatus.version == 0)\
 
            .filter(ChangesetStatus.revision.in_(revisions))
 
        grouped = {}
 

	
 
        #maybe we have open new pullrequest without a status ?
0 comments (0 inline, 0 general)