Changeset - 95c38de476a7
[Not reviewed]
beta
0 1 0
Marcin Kuzminski - 13 years ago 2013-02-19 19:48:45
marcin@python-works.com
cleanup would recurse into every leaf and could thus not be used on lots of
large repositories.
1 file changed with 8 insertions and 1 deletions:
0 comments (0 inline, 0 general)
rhodecode/lib/paster_commands/cleanup.py
Show inline comments
 
@@ -82,16 +82,23 @@ class Command(BasePasterCommand):
 
        #get SqlAlchemy session
 
        self._init_session()
 

	
 
        repos_location = RhodeCodeUi.get_repos_location()
 
        to_remove = []
 
        for dn, dirs, f in os.walk(safe_str(repos_location)):
 
            for loc in dirs:
 
            alldirs = list(dirs)
 
            del dirs[:]
 
            if ('.hg' in alldirs or
 
                'objects' in alldirs and ('refs' in alldirs or 'packed-refs' in f)):
 
                continue
 
            for loc in alldirs:
 
                if REMOVED_REPO_PAT.match(loc):
 
                    to_remove.append([os.path.join(dn, loc),
 
                                      self._extract_date(loc)])
 
                else:
 
                    dirs.append(loc)
 

	
 
        #filter older than (if present)!
 
        now = datetime.datetime.now()
 
        older_than = self.options.older_than
 
        if older_than:
 
            to_remove_filtered = []
0 comments (0 inline, 0 general)