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

Side by Side Diff: apply_issue.py

Issue 11028002: Make apply_issue.py much more verbose about what it's doing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Fix unit test Created 8 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | checkout.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Applies an issue from Rietveld. 6 """Applies an issue from Rietveld.
7 """ 7 """
8 8
9 import getpass 9 import getpass
10 import logging 10 import logging
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 125
126 # TODO(maruel): HACK, remove me. 126 # TODO(maruel): HACK, remove me.
127 # When run a build slave, make sure buildbot knows that the checkout was 127 # When run a build slave, make sure buildbot knows that the checkout was
128 # modified. 128 # modified.
129 if options.root_dir == 'src' and getpass.getuser() == 'chrome-bot': 129 if options.root_dir == 'src' and getpass.getuser() == 'chrome-bot':
130 # See sourcedirIsPatched() in: 130 # See sourcedirIsPatched() in:
131 # http://src.chromium.org/viewvc/chrome/trunk/tools/build/scripts/slave/ 131 # http://src.chromium.org/viewvc/chrome/trunk/tools/build/scripts/slave/
132 # chromium_commands.py?view=markup 132 # chromium_commands.py?view=markup
133 open('.buildbot-patched', 'w').close() 133 open('.buildbot-patched', 'w').close()
134 134
135 # Apply the patch. 135 print('\nApplying the patch.')
136 try: 136 try:
137 scm_obj.apply_patch(patchset) 137 scm_obj.apply_patch(patchset, verbose=True)
138 except checkout.PatchApplicationFailed, e: 138 except checkout.PatchApplicationFailed, e:
139 print >> sys.stderr, str(e) 139 print >> sys.stderr, str(e)
140 return 1 140 return 1
141 141
142 if 'DEPS' in map(os.path.basename, patchset.filenames): 142 if 'DEPS' in map(os.path.basename, patchset.filenames):
143 gclient_root = gclient_utils.FindGclientRoot(options.root_dir) 143 gclient_root = gclient_utils.FindGclientRoot(options.root_dir)
144 if gclient_root and scm_type: 144 if gclient_root and scm_type:
145 print( 145 print(
146 'A DEPS file was updated inside a gclient checkout, running gclient ' 146 'A DEPS file was updated inside a gclient checkout, running gclient '
147 'sync.') 147 'sync.')
148 base_rev = 'BASE' if scm_type == 'svn' else 'HEAD' 148 base_rev = 'BASE' if scm_type == 'svn' else 'HEAD'
149 gclient_path = os.path.join(BASE_DIR, 'gclient') 149 gclient_path = os.path.join(BASE_DIR, 'gclient')
150 if sys.platform == 'win32': 150 if sys.platform == 'win32':
151 gclient_path += '.bat' 151 gclient_path += '.bat'
152 return subprocess.call( 152 return subprocess.call(
153 [gclient_path, 'sync', '--revision', base_rev], cwd=gclient_root) 153 [gclient_path, 'sync', '--revision', base_rev], cwd=gclient_root)
154 return 0 154 return 0
155 155
156 156
157 if __name__ == "__main__": 157 if __name__ == "__main__":
158 fix_encoding.fix_encoding() 158 fix_encoding.fix_encoding()
159 sys.exit(main()) 159 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | checkout.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698