Changeset - 968b28545f93
[Not reviewed]
beta
0 1 0
Marcin Kuzminski - 13 years ago 2013-02-08 19:08:52
marcin@python-works.com
fixed description of update-repoinfo command
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
rhodecode/lib/update_repoinfo.py
Show inline comments
 
@@ -31,49 +31,49 @@ import datetime
 
import string
 

	
 
from os.path import dirname as dn, join as jn
 
from rhodecode.model import init_model
 
from rhodecode.lib.utils2 import engine_from_config
 
from rhodecode.model.db import Repository
 
from rhodecode.model.repo import RepoModel
 
from rhodecode.model.meta import Session
 

	
 

	
 
#to get the rhodecode import
 
sys.path.append(dn(dn(dn(os.path.realpath(__file__)))))
 

	
 
from rhodecode.lib.utils import BasePasterCommand, Command, add_cache
 

	
 
log = logging.getLogger(__name__)
 

	
 

	
 
class UpdateCommand(BasePasterCommand):
 

	
 
    max_args = 1
 
    min_args = 1
 

	
 
    usage = "CONFIG_FILE"
 
    summary = "Cleanup deleted repos"
 
    summary = "Updates repositories caches for last changeset"
 
    group_name = "RhodeCode"
 
    takes_config_file = -1
 
    parser = Command.standard_parser(verbose=True)
 

	
 
    def command(self):
 
        logging.config.fileConfig(self.path_to_ini_file)
 
        from pylons import config
 

	
 
        #get to remove repos !!
 
        add_cache(config)
 
        engine = engine_from_config(config, 'sqlalchemy.db1.')
 
        init_model(engine)
 

	
 
        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()
0 comments (0 inline, 0 general)