Changeset - 737c3704b44a
[Not reviewed]
stable
0 4 0
Mads Kiilerich - 10 years ago 2015-11-07 13:16:58
madski@unity3d.com
cleanup: fixes of checking for None

Don't update repoinfo for all repos if an invalid repo is specified.
4 files changed with 4 insertions and 4 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/paster_commands/update_repoinfo.py
Show inline comments
 
@@ -60,13 +60,13 @@ class Command(BasePasterCommand):
 
        self._init_session()
 

	
 
        repo_update_list = map(string.strip,
 
                               self.options.repo_update_list.split(',')) \
 
                               if self.options.repo_update_list else None
 

	
 
        if repo_update_list:
 
        if repo_update_list is not None:
 
            repo_list = list(Repository.query()\
 
                .filter(Repository.repo_name.in_(repo_update_list)))
 
        else:
 
            repo_list = Repository.getAll()
 
        RepoModel.update_repoinfo(repositories=repo_list)
 
        Session().commit()
kallithea/lib/vcs/backends/git/changeset.py
Show inline comments
 
@@ -284,13 +284,13 @@ class GitChangeset(BaseChangeset):
 
        iterating commits.
 
        """
 
        self._get_filectx(path)
 
        cs_id = safe_str(self.id)
 
        f_path = safe_str(path)
 

	
 
        if limit:
 
        if limit is not None:
 
            cmd = ['log', '-n', str(safe_int(limit, 0)),
 
                   '--pretty=format:%H', '-s', cs_id, '--', f_path]
 

	
 
        else:
 
            cmd = ['log',
 
                   '--pretty=format:%H', '-s', cs_id, '--', f_path]
kallithea/lib/vcs/backends/hg/changeset.py
Show inline comments
 
@@ -253,13 +253,13 @@ class MercurialChangeset(BaseChangeset):
 
        fctx = self._get_filectx(path)
 
        hist = []
 
        cnt = 0
 
        for cs in reversed([x for x in fctx.filelog()]):
 
            cnt += 1
 
            hist.append(hex(fctx.filectx(cs).node()))
 
            if limit and cnt == limit:
 
            if limit is not None and cnt == limit:
 
                break
 

	
 
        return [self.repository.get_changeset(node) for node in hist]
 

	
 
    def get_file_annotate(self, path):
 
        """
kallithea/model/repo.py
Show inline comments
 
@@ -172,13 +172,13 @@ class RepoModel(BaseModel):
 
        tmpl = template.get_def(tmpl)
 
        kwargs.update(dict(_=_, h=h, c=c))
 
        return tmpl.render(*args, **kwargs)
 

	
 
    @classmethod
 
    def update_repoinfo(cls, repositories=None):
 
        if not repositories:
 
        if repositories is None:
 
            repositories = Repository.getAll()
 
        for repo in repositories:
 
            repo.update_changeset_cache()
 

	
 
    def get_repos_as_dict(self, repos_list=None, admin=False, perm_check=True,
 
                          super_user_actions=False):
0 comments (0 inline, 0 general)