##// END OF EJS Templates
accept that repos are read-only - very convenient for testing....
marcink -
r3980:3648a2b2 default
parent child Browse files
Show More
@@ -614,16 +614,24 b' class DbManage(object):'
614 # check proper dir
614 # check proper dir
615 if not os.path.isdir(path):
615 if not os.path.isdir(path):
616 path_ok = False
616 path_ok = False
617 log.error('Given path %s is not a valid directory' % path)
617 log.error('Given path %s is not a valid directory' % (path,))
618
618
619 elif not os.path.isabs(path):
619 elif not os.path.isabs(path):
620 path_ok = False
620 path_ok = False
621 log.error('Given path %s is not an absolute path' % path)
621 log.error('Given path %s is not an absolute path' % (path,))
622
623 # check if path is at least readable.
624 if not os.access(path, os.R_OK):
625 path_ok = False
626 log.error('Given path %s is not readable' % (path,))
622
627
623 # check write access
628 # check write access, warn user about non writeable paths
624 elif not os.access(path, os.W_OK) and path_ok:
629 elif not os.access(path, os.W_OK) and path_ok:
625 path_ok = False
630 log.warn('No write permission to given path %s' % (path,))
626 log.error('No write permission to given path %s' % path)
631 if not ask_ok('Given path %s is not writeable, do you want to '
632 'continue with read only mode ? [y/n]' % (path,)):
633 log.error('Canceled by user')
634 sys.exit(-1)
627
635
628 if retries == 0:
636 if retries == 0:
629 sys.exit('max retries reached')
637 sys.exit('max retries reached')
@@ -635,7 +643,7 b' class DbManage(object):'
635
643
636 if real_path != os.path.normpath(path):
644 if real_path != os.path.normpath(path):
637 if not ask_ok(('Path looks like a symlink, Rhodecode will store '
645 if not ask_ok(('Path looks like a symlink, Rhodecode will store '
638 'given path as %s ? [y/n]') % (real_path)):
646 'given path as %s ? [y/n]') % (real_path,)):
639 log.error('Canceled by user')
647 log.error('Canceled by user')
640 sys.exit(-1)
648 sys.exit(-1)
641
649
@@ -201,9 +201,11 b' def get_filesystem_repos(path, recursive'
201 log.debug('now scanning in %s location recursive:%s...' % (path, recursive))
201 log.debug('now scanning in %s location recursive:%s...' % (path, recursive))
202
202
203 def _get_repos(p):
203 def _get_repos(p):
204 if not os.access(p, os.R_OK) or not os.access(p, os.X_OK):
205 log.warn('ignoring repo path without access: %s', p)
206 return
204 if not os.access(p, os.W_OK):
207 if not os.access(p, os.W_OK):
205 log.warn('ignoring repo path without write access: %s', p)
208 log.warn('repo path without write access: %s', p)
206 return
207 for dirpath in os.listdir(p):
209 for dirpath in os.listdir(p):
208 if os.path.isfile(os.path.join(p, dirpath)):
210 if os.path.isfile(os.path.join(p, dirpath)):
209 continue
211 continue
@@ -744,9 +744,12 b' class ScmModel(BaseModel):'
744
744
745 if _rhodecode_hook or force_create:
745 if _rhodecode_hook or force_create:
746 log.debug('writing %s hook file !' % (h_type,))
746 log.debug('writing %s hook file !' % (h_type,))
747 try:
747 with open(_hook_file, 'wb') as f:
748 with open(_hook_file, 'wb') as f:
748 tmpl = tmpl.replace('_TMPL_', rhodecode.__version__)
749 tmpl = tmpl.replace('_TMPL_', rhodecode.__version__)
749 f.write(tmpl)
750 f.write(tmpl)
750 os.chmod(_hook_file, 0755)
751 os.chmod(_hook_file, 0755)
752 except IOError, e:
753 log.error('error writing %s: %s' % (_hook_file, e))
751 else:
754 else:
752 log.debug('skipping writing hook file')
755 log.debug('skipping writing hook file')
General Comments 0
You need to be logged in to leave comments. Login now