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

Unified Diff: commit-queue/post_processors/chromium_copyright.py

Issue 135363007: Delete public commit queue to avoid confusion after move to internal repo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/
Patch Set: Created 6 years, 10 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 | « commit-queue/pending_manager.py ('k') | commit-queue/projects.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: commit-queue/post_processors/chromium_copyright.py
===================================================================
--- commit-queue/post_processors/chromium_copyright.py (revision 249146)
+++ commit-queue/post_processors/chromium_copyright.py (working copy)
@@ -1,41 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import datetime
-import os
-import re
-
-import errors
-
-
-def process(checkout, patch):
- """Enforces current year in Chromium copyright."""
- pattern = (
- r'^(.*)Copyright (?:\(c\) )?\d{4}(|-\d{4}) The Chromium Authors. '
- r'All rights reserved.$')
- replacement = (
- r'\1Copyright %s The Chromium Authors. All rights reserved.' %
- datetime.date.today().year)
-
- if not patch.is_new or patch.is_binary:
- return
- filepath = os.path.join(checkout.project_path, patch.filename)
- try:
- with open(filepath, 'rb') as f:
- lines = f.read().splitlines(True)
- except IOError, e:
- errors.send_stack(e)
- lines = None
- if not lines:
- return
- modified = False
- for i in xrange(min(5, len(lines))):
- old_line = lines[i]
- lines[i] = re.sub(pattern, replacement, lines[i])
- if old_line != lines[i]:
- modified = True
- break
- if modified:
- with open(filepath, 'wb') as f:
- f.write(''.join(lines))
« no previous file with comments | « commit-queue/pending_manager.py ('k') | commit-queue/projects.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698