From 1d3f02c7167886898bd8236a9b80ab630671afc5 Mon Sep 17 00:00:00 2001 From: "jam@chromium.org" Date: Fri, 14 Dec 2012 06:25:01 +0000 Subject: [PATCH] Revert 171153 to add a presubmit check to check for closed issues. BUG=161702 Review URL: https://chromiumcodereview.appspot.com/11566014 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@173104 0039d316-1c4b-4281-b951-d872f2087c98 --- presubmit_canned_checks.py | 19 ------------------- tests/presubmit_unittest.py | 19 ------------------- 2 files changed, 38 deletions(-) diff --git a/presubmit_canned_checks.py b/presubmit_canned_checks.py index e7ca98fdfa..7fbedecef5 100644 --- a/presubmit_canned_checks.py +++ b/presubmit_canned_checks.py @@ -799,21 +799,6 @@ def _GetRietveldIssueProps(input_api, messages): issue=int(issue), messages=messages) -def CheckIssueNotClosed(input_api, output_api): - """Verifies issue is not closed. - - We should not be working with a closed review. CQ and dcommit set this bit, - so it is a pretty good indicator of whether an issue has been committed. - """ - issue_props = _GetRietveldIssueProps(input_api=input_api, messages=False) - if issue_props and issue_props['closed']: - return [output_api.PresubmitError( - 'Issue %s is closed. You can reset the issue number associated with\n' - 'this branch with: git cl issue 0\n' % issue_props['issue'] - )] - return [] - - def _RietveldOwnerAndReviewers(input_api, email_regexp, approval_needed=False): """Return the owner and reviewers of a change, if any. @@ -962,10 +947,6 @@ def PanProjectChecks(input_api, output_api, results.extend(input_api.canned_checks.CheckOwners( input_api, output_api, source_file_filter=None)) - snapshot("checking review not closed") - results.extend(input_api.canned_checks.CheckIssueNotClosed( - input_api, output_api)) - snapshot("checking long lines") results.extend(input_api.canned_checks.CheckLongLines( input_api, output_api, source_file_filter=sources)) diff --git a/tests/presubmit_unittest.py b/tests/presubmit_unittest.py index 49f5386931..f803335863 100755 --- a/tests/presubmit_unittest.py +++ b/tests/presubmit_unittest.py @@ -1507,7 +1507,6 @@ class CannedChecksUnittest(PresubmitTestsBase): 'CheckLongLines', 'CheckTreeIsOpen', 'PanProjectChecks', 'CheckLicense', 'CheckOwners', - 'CheckIssueNotClosed', 'CheckRietveldTryJobExecution', 'CheckSingletonInHeaders', 'CheckSvnModifiedDirectories', @@ -2396,24 +2395,6 @@ class CannedChecksUnittest(PresubmitTestsBase): is_committing=False, uncovered_dirs=set()) - def CheckIssueClosedBase(self, closed): - input_api = self.MockInputApi( - presubmit.Change('', '', None, None, 1, 0, None), False) - input_api.rietveld.get_issue_properties( - issue=int(input_api.change.issue), messages=False).AndReturn( - {'closed': closed, 'issue': 1}) - self.mox.ReplayAll() - return presubmit_canned_checks.CheckIssueNotClosed( - input_api, presubmit.OutputApi) - - def testIssueOpen(self): - self.assertEqual([], self.CheckIssueClosedBase(False)) - - def testIssueClosed(self): - results = self.CheckIssueClosedBase(True) - self.assertEqual(len(results), 1) - self.assertTrue(results[0].fatal) - def testCannedRunUnitTests(self): change = presubmit.Change( 'foo1', 'description1', self.fake_root_dir, None, 0, 0, None)