| Index: tools/checkperms/checkperms.py
|
| diff --git a/tools/checkperms/checkperms.py b/tools/checkperms/checkperms.py
|
| index abc663489b1c6c9559de04df54a9c5139c11e6a9..ccb76541df4356a521f0c1881f98af04712c472b 100755
|
| --- a/tools/checkperms/checkperms.py
|
| +++ b/tools/checkperms/checkperms.py
|
| @@ -5,7 +5,7 @@
|
|
|
| """Makes sure files have the right permissions.
|
|
|
| -Some developers have broken SCM configurations that flip the svn:executable
|
| +Some developers have broken SCM configurations that flip the executable
|
| permission on for no good reason. Unix developers who run ls --color will then
|
| see .cc files in green and get confused.
|
|
|
| @@ -230,34 +230,6 @@ def capture(cmd, cwd):
|
| return p.communicate()[0]
|
|
|
|
|
| -def get_svn_info(dir_path):
|
| - """Returns svn meta-data for a svn checkout."""
|
| - if not os.path.isdir(dir_path):
|
| - return {}
|
| - out = capture(['svn', 'info', '.', '--non-interactive'], dir_path)
|
| - return dict(l.split(': ', 1) for l in out.splitlines() if l)
|
| -
|
| -
|
| -def get_svn_url(dir_path):
|
| - return get_svn_info(dir_path).get('URL')
|
| -
|
| -
|
| -def get_svn_root(dir_path):
|
| - """Returns the svn checkout root or None."""
|
| - svn_url = get_svn_url(dir_path)
|
| - if not svn_url:
|
| - return None
|
| - logging.info('svn url: %s' % svn_url)
|
| - while True:
|
| - parent = os.path.dirname(dir_path)
|
| - if parent == dir_path:
|
| - return None
|
| - svn_url = svn_url.rsplit('/', 1)[0]
|
| - if svn_url != get_svn_url(parent):
|
| - return dir_path
|
| - dir_path = parent
|
| -
|
| -
|
| def get_git_root(dir_path):
|
| """Returns the git checkout root or None."""
|
| root = capture(['git', 'rev-parse', '--show-toplevel'], dir_path).strip()
|
| @@ -402,24 +374,6 @@ class ApiBase(object):
|
| )
|
|
|
|
|
| -class ApiSvnQuick(ApiBase):
|
| - """Returns all files in svn-versioned directories, independent of the fact if
|
| - they are versionned.
|
| -
|
| - Uses svn info in each directory to determine which directories should be
|
| - crawled.
|
| - """
|
| - def __init__(self, *args):
|
| - super(ApiSvnQuick, self).__init__(*args)
|
| - self.url = get_svn_url(self.root_dir)
|
| -
|
| - def check_dir(self, rel_path):
|
| - url = self.url + '/' + rel_path
|
| - if get_svn_url(os.path.join(self.root_dir, rel_path)) != url:
|
| - return []
|
| - return super(ApiSvnQuick, self).check_dir(rel_path)
|
| -
|
| -
|
| class ApiAllFilesAtOnceBase(ApiBase):
|
| _files = None
|
|
|
| @@ -439,18 +393,6 @@ class ApiAllFilesAtOnceBase(ApiBase):
|
| raise NotImplementedError()
|
|
|
|
|
| -class ApiSvn(ApiAllFilesAtOnceBase):
|
| - """Returns all the subversion controlled files.
|
| -
|
| - Warning: svn ls is abnormally slow.
|
| - """
|
| - def _get_all_files(self):
|
| - cmd = ['svn', 'ls', '--non-interactive', '--recursive']
|
| - return (
|
| - x for x in capture(cmd, self.root_dir).splitlines()
|
| - if not x.endswith(os.path.sep))
|
| -
|
| -
|
| class ApiGit(ApiAllFilesAtOnceBase):
|
| def _get_all_files(self):
|
| return capture(['git', 'ls-files'], cwd=self.root_dir).splitlines()
|
| @@ -459,11 +401,6 @@ class ApiGit(ApiAllFilesAtOnceBase):
|
| def get_scm(dir_path, bare):
|
| """Returns a properly configured ApiBase instance."""
|
| cwd = os.getcwd()
|
| - root = get_svn_root(dir_path or cwd)
|
| - if root:
|
| - if not bare:
|
| - print('Found subversion checkout at %s' % root)
|
| - return ApiSvnQuick(dir_path or root, bare)
|
| root = get_git_root(dir_path or cwd)
|
| if root:
|
| if not bare:
|
|
|