diff options
author | thestig <thestig@chromium.org> | 2014-08-26 15:25:37 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-08-26 22:32:00 +0000 |
commit | 51c6b19a8cd3c7d089d2eee20ba1be4715914ddf (patch) | |
tree | 9955fd42f9d3216d01452a9b71a99ff1d042ad41 | |
parent | ea8fe7d444b12836640936bd355cde152e3411b8 (diff) | |
download | chromium_src-51c6b19a8cd3c7d089d2eee20ba1be4715914ddf.zip chromium_src-51c6b19a8cd3c7d089d2eee20ba1be4715914ddf.tar.gz chromium_src-51c6b19a8cd3c7d089d2eee20ba1be4715914ddf.tar.bz2 |
Remove svn code in checkperms.py after the git migration.
Review URL: https://codereview.chromium.org/503853002
Cr-Commit-Position: refs/heads/master@{#292001}
-rwxr-xr-x | tools/checkperms/checkperms.py | 65 |
1 files changed, 1 insertions, 64 deletions
diff --git a/tools/checkperms/checkperms.py b/tools/checkperms/checkperms.py index abc6634..ccb7654 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: |