OLD | NEW |
---|---|
1 # Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import os | 5 import os |
6 import re | 6 import re |
7 import subprocess | 7 import subprocess |
8 import sys | 8 import sys |
9 | 9 |
10 import breakpad | 10 import breakpad |
(...skipping 24 matching lines...) Expand all Loading... | |
35 if not root: | 35 if not root: |
36 raise Exception("Could not get root directory.") | 36 raise Exception("Could not get root directory.") |
37 log = Backquote(['git', 'show', '--name-only', | 37 log = Backquote(['git', 'show', '--name-only', |
38 '--pretty=format:%H%n%s%n%n%b']) | 38 '--pretty=format:%H%n%s%n%n%b']) |
39 m = re.match(r'^(\w+)\n(.*)$', log, re.MULTILINE|re.DOTALL) | 39 m = re.match(r'^(\w+)\n(.*)$', log, re.MULTILINE|re.DOTALL) |
40 if not m: | 40 if not m: |
41 raise Exception("Could not parse log message: %s" % log) | 41 raise Exception("Could not parse log message: %s" % log) |
42 name = m.group(1) | 42 name = m.group(1) |
43 files = scm.GIT.CaptureStatus([root], upstream_branch) | 43 files = scm.GIT.CaptureStatus([root], upstream_branch) |
44 issue = Backquote(['git', 'cl', 'status', '--field=id']) | 44 issue = Backquote(['git', 'cl', 'status', '--field=id']) |
45 if issue == "None": | 45 try: |
46 description = gcl.GetIssueDescription(int(issue)) | |
chase
2010/01/08 20:15:56
I suspect this code is a no-op on my system.. md5s
Robert Sesek
2010/01/08 20:23:46
I'm on a Mac, FYI:
[src (gtk-cookie-test)] rsesek
| |
47 except ValueError: | |
46 description = m.group(2) | 48 description = m.group(2) |
47 else: | |
48 description = gcl.GetIssueDescription(int(issue)) | |
49 patchset = None | 49 patchset = None |
50 self.change = presubmit_support.GitChange(name, description, absroot, files, | 50 self.change = presubmit_support.GitChange(name, description, absroot, files, |
51 issue, patchset) | 51 issue, patchset) |
52 | 52 |
53 | 53 |
54 def RunHooks(hook_name, upstream_branch): | 54 def RunHooks(hook_name, upstream_branch): |
55 commit = (hook_name == 'pre-cl-dcommit') | 55 commit = (hook_name == 'pre-cl-dcommit') |
56 | 56 |
57 # Create our options based on the command-line args and the current checkout. | 57 # Create our options based on the command-line args and the current checkout. |
58 options = ChangeOptions(commit=commit, upstream_branch=upstream_branch) | 58 options = ChangeOptions(commit=commit, upstream_branch=upstream_branch) |
(...skipping 10 matching lines...) Expand all Loading... | |
69 if presubmit_support.DoPresubmitChecks(options.change, | 69 if presubmit_support.DoPresubmitChecks(options.change, |
70 options.commit, | 70 options.commit, |
71 options.verbose, | 71 options.verbose, |
72 sys.stdout, | 72 sys.stdout, |
73 sys.stdin, | 73 sys.stdin, |
74 options.default_presubmit, | 74 options.default_presubmit, |
75 options.may_prompt): | 75 options.may_prompt): |
76 sys.exit(0) | 76 sys.exit(0) |
77 else: | 77 else: |
78 sys.exit(1) | 78 sys.exit(1) |
OLD | NEW |