changeset 1221:e4784e2b03f7 beta

strip os.sep instead of '/' in repo scanner
author Marcin Kuzminski <marcin@python-works.com>
date Wed, 06 Apr 2011 20:16:02 +0200
parents 208b15340dfa
children 2c246d24eb90
files rhodecode/lib/utils.py
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/lib/utils.py	Wed Apr 06 20:06:28 2011 +0200
+++ b/rhodecode/lib/utils.py	Wed Apr 06 20:16:02 2011 +0200
@@ -152,12 +152,15 @@
     from vcs.utils.helpers import get_scm
     from vcs.exceptions import VCSError
 
-    if path.endswith('/'):
-        #add ending slash for better results
+    if path.endswith(os.sep):
+        #remove ending slash for better results
         path = path[:-1]
 
     def _get_repos(p):
+        if not os.access(p, os.W_OK):
+            return
         for dirpath in os.listdir(p):
+            print dirpath
             if os.path.isfile(os.path.join(p, dirpath)):
                 continue
             cur_path = os.path.join(p, dirpath)
@@ -616,7 +619,6 @@
     tar.extractall(jn(TESTS_TMP_PATH, HG_REPO))
     tar.close()
 
-
 #==============================================================================
 # PASTER COMMANDS
 #==============================================================================