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

Unified Diff: presubmit_canned_checks.py

Issue 1435333005: Remove unused CheckSvnModifiedDirectories. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 5 years, 1 month 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 | tests/presubmit_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: presubmit_canned_checks.py
diff --git a/presubmit_canned_checks.py b/presubmit_canned_checks.py
index c04f84cf01fc7fcc6d775bacfc26c41f6483b1f6..70037c388fe4ac8698aa9ac7c0071070e38c92a1 100644
--- a/presubmit_canned_checks.py
+++ b/presubmit_canned_checks.py
@@ -161,42 +161,6 @@ def CheckChangeHasNoCR(input_api, output_api, source_file_filter=None):
return []
-def CheckSvnModifiedDirectories(input_api, output_api, source_file_filter=None):
- """Checks for files in svn modified directories.
-
- They will get submitted on accident because svn commits recursively by
- default, and that's very dangerous.
- """
- if input_api.change.scm != 'svn':
- return []
-
- errors = []
- current_cl_files = input_api.change.GetModifiedFiles()
- all_modified_files = input_api.change.GetAllModifiedFiles()
- # Filter out files in the current CL.
- modified_files = [f for f in all_modified_files if f not in current_cl_files]
- modified_abspaths = [input_api.os_path.abspath(f) for f in modified_files]
-
- for f in input_api.AffectedFiles(file_filter=source_file_filter):
- if f.Action() == 'M' and f.IsDirectory():
- curpath = f.AbsoluteLocalPath()
- bad_files = []
- # Check if any of the modified files in other CLs are under curpath.
- for i in xrange(len(modified_files)):
- abspath = modified_abspaths[i]
- if input_api.os_path.commonprefix([curpath, abspath]) == curpath:
- bad_files.append(modified_files[i])
- if bad_files:
- if input_api.is_committing:
- error_type = output_api.PresubmitPromptWarning
- else:
- error_type = output_api.PresubmitNotifyResult
- errors.append(error_type(
- 'Potential accidental commits in changelist %s:' % f.LocalPath(),
- items=bad_files))
- return errors
-
-
def CheckChangeHasOnlyOneEol(input_api, output_api, source_file_filter=None):
"""Checks the files ends with one and only one \n (LF)."""
eof_files = []
« no previous file with comments | « no previous file | tests/presubmit_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698