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

Unified Diff: presubmit_support.py

Issue 113883: Remove SPECIAL_KEYS and GclChange.Changelist() to simplify the code. (Closed)
Patch Set: Created 11 years, 7 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 | « presubmit_canned_checks.py ('k') | tests/presubmit_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: presubmit_support.py
diff --git a/presubmit_support.py b/presubmit_support.py
index de69727242025239c0812c7fed854f4e0ed4bf97..d4361d4958908a3e5bf21d32758f104d4f2c1f65 100755
--- a/presubmit_support.py
+++ b/presubmit_support.py
@@ -41,21 +41,6 @@ _tag_line_re = re.compile(
'^\s*(?P<key>[A-Z][A-Z_0-9]*)\s*=\s*(?P<value>.*?)\s*$')
-# Friendly names may be used for certain keys. All values for key-value pairs
-# in change descriptions (like BUG=123) can be retrieved from a change object
-# directly as if they were attributes, e.g. change.R (or equivalently because
-# we have a friendly name for it, change.Reviewers), change.BUG (or
-# change.BugIDs) and so forth.
-#
-# Add to this mapping as needed/desired.
-SPECIAL_KEYS = {
- 'Reviewers' : 'R',
- 'BugIDs' : 'BUG',
- 'Tested': 'TESTED',
- 'Test': 'TEST'
-}
-
-
class NotImplementedException(Exception):
"""We're leaving placeholders in a bunch of places to remind us of the
design of the API, but we have not implemented all of it yet. Implement as
@@ -459,10 +444,6 @@ class GclChange(object):
"""Returns the change name."""
return self.name
- def Changelist(self):
- """Synonym for Change()."""
- return self.Change()
-
def DescriptionText(self):
"""Returns the user-entered changelist description, minus tags.
@@ -486,12 +467,7 @@ class GclChange(object):
You may use a friendly name (from SPECIAL_KEYS) or the actual name of
the key.
"""
- if attr in SPECIAL_KEYS:
- key = SPECIAL_KEYS[attr]
- if key in self.tags:
- return self.tags[key]
- if attr in self.tags:
- return self.tags[attr]
+ return self.tags.get(attr)
def AffectedFiles(self, include_dirs=False, include_deletes=True):
"""Returns a list of AffectedFile instances for all files in the change.
« no previous file with comments | « presubmit_canned_checks.py ('k') | tests/presubmit_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698