Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Unified Diff: tools/checkperms/checkperms.py

Issue 503853002: Remove svn code in checkperms.py after the git migration. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698