1. codingtony
  2. RhodeCode

Commits

Marcin Kuzminski  committed 003c504

fixed issues with removed repos was accidentally added as groups, after
full rescan of paths

  • Participants
  • Parent commits f664d3b
  • Branches beta

Comments (0)

Files changed (3)

File docs/changelog.rst

View file
 +++++
 
 - fixed some python2.5 compatibility issues 
+- fixed issues with removed repos was accidentally added as groups, after
+  full rescan of paths
 
 1.3.2 (**2012-02-28**)
 ----------------------

File rhodecode/lib/utils.py

View file
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 import os
+import re
 import logging
 import datetime
 import traceback
 
 log = logging.getLogger(__name__)
 
+REMOVED_REPO_PAT = re.compile(r'rm__\d{8}_\d{6}_\d{6}__.*')
+
 
 def recursive_replace(str_, replace=' '):
     """Recursive replace of given sign to just one instance
 #            group = rgm.create(group_name, desc, parent, just_db=True)
 #            sa.commit()
 
+        # skip folders that are now removed repos
+        if REMOVED_REPO_PAT.match(group_name):
+            break
+
         if group is None:
             log.debug('creating group level: %s group_name: %s' % (lvl, group_name))
             group = RepoGroup(group_name, parent)

File rhodecode/model/scm.py

View file
 from rhodecode.lib import safe_str
 from rhodecode.lib.auth import HasRepoPermissionAny, HasReposGroupPermissionAny
 from rhodecode.lib.utils import get_repos as get_filesystem_repos, make_ui, \
-    action_logger, EmptyChangeset
+    action_logger, EmptyChangeset, REMOVED_REPO_PAT
 from rhodecode.model import BaseModel
 from rhodecode.model.db import Repository, RhodeCodeUi, CacheInvalidation, \
     UserFollowing, UserLog, User, RepoGroup
         repos = {}
 
         for name, path in get_filesystem_repos(repos_path, recursive=True):
+            # skip removed repos
+            if REMOVED_REPO_PAT.match(name):
+                continue
 
             # name need to be decomposed and put back together using the /
             # since this is internal storage separator for rhodecode