@@ -82,25 +82,26 @@ class CleanupCommand(BasePasterCommand):
from pylons import config
#get to remove repos !!
add_cache(config)
engine = engine_from_config(config, 'sqlalchemy.db1.')
init_model(engine)
repos_location = RhodeCodeUi.get_repos_location()
to_remove = []
for dn, dirs, f in os.walk(safe_str(repos_location)):
for loc in dirs:
if REMOVED_REPO_PAT.match(loc):
to_remove.append([loc, self._extract_date(loc)])
to_remove.append([os.path.join(dn, loc),
self._extract_date(loc)])
#filter older than (if present)!
now = datetime.datetime.now()
older_than = self.options.older_than
if older_than:
to_remove_filtered = []
older_than_date = self._parse_older_than(older_than)
for name, date_ in to_remove:
repo_age = now - date_
if repo_age > older_than_date:
to_remove_filtered.append([name, date_])
Status change: