Changeset - e08321d4c106
[Not reviewed]
beta
0 1 0
Marcin Kuzminski - 13 years ago 2013-03-11 15:31:30
marcin@python-works.com
add --invalidate-cache option to update-repoinfo command
1 file changed with 14 insertions and 5 deletions:
0 comments (0 inline, 0 general)
rhodecode/lib/paster_commands/update_repoinfo.py
Show inline comments
 
@@ -59,21 +59,30 @@ class Command(BasePasterCommand):
 

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

	
 
        if repo_update_list:
 
            repo_list = Repository.query()\
 
                .filter(Repository.repo_name.in_(repo_update_list))
 
        else:
 
            repo_list = Repository.getAll()
 
        RepoModel.update_repoinfo(repositories=repo_list)
 
        Session().commit()
 

	
 
        if self.options.invalidate_cache:
 
            for r in repo_list:
 
                r.invalidate
 
        Session().commit()
 
        log.info('Updated cache for %s repositories' % (len(repo_list)))
 

	
 
    def update_parser(self):
 
        self.parser.add_option('--update-only',
 
                          action='store',
 
                          dest='repo_update_list',
 
                          help="Specifies a comma separated list of repositores "
 
                                "to update last commit info for. OPTIONAL",
 
                          )
 
                           action='store',
 
                           dest='repo_update_list',
 
                           help="Specifies a comma separated list of repositores "
 
                                "to update last commit info for. OPTIONAL")
 
        self.parser.add_option('--invalidate-cache',
 
                           action='store_true',
 
                           dest='invalidate_cache',
 
                           help="Trigger cache invalidation event for repos. "
 
                                "OPTIONAL")
0 comments (0 inline, 0 general)