Find the HASHTAGS file even if you are not at the checkout root.
authorrmistry <rmistry@google.com>
Wed, 1 Apr 2015 16:12:51 +0000 (09:12 -0700)
committerCommit bot <commit-bot@chromium.org>
Wed, 1 Apr 2015 16:12:51 +0000 (09:12 -0700)
The post upload hook was failing if you were not at the root, this fixes it.

NOTRY=true

Review URL: https://codereview.chromium.org/1058483002

PRESUBMIT.py

index 8b60774..a036be6 100644 (file)
@@ -392,7 +392,8 @@ def PostUploadHook(cl, change, output_api):
                 'Automatically added \'NOTRY=true\' to the CL\'s description'))
 
     # Read and process the HASHTAGS file.
-    with open('HASHTAGS', 'rb') as hashtags_csv:
+    hashtags_fullpath = os.path.join(change._local_root, 'HASHTAGS')
+    with open(hashtags_fullpath, 'rb') as hashtags_csv:
       hashtags_reader = csv.reader(hashtags_csv, delimiter=',')
       for row in hashtags_reader:
         if not row or row[0].startswith('#'):