OLD | NEW |
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 import getpass | 8 import getpass |
9 import json | 9 import json |
10 import logging | 10 import logging |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 patchset.patches = [patch for patch in patchset.patches | 258 patchset.patches = [patch for patch in patchset.patches |
259 if patch.filename not in options.blacklist] | 259 if patch.filename not in options.blacklist] |
260 for patch in patchset.patches: | 260 for patch in patchset.patches: |
261 print(patch) | 261 print(patch) |
262 if options.extra_patchlevel: | 262 if options.extra_patchlevel: |
263 patch.patchlevel += options.extra_patchlevel | 263 patch.patchlevel += options.extra_patchlevel |
264 full_dir = os.path.abspath(options.root_dir) | 264 full_dir = os.path.abspath(options.root_dir) |
265 scm_type = scm.determine_scm(full_dir) | 265 scm_type = scm.determine_scm(full_dir) |
266 if scm_type == 'git': | 266 if scm_type == 'git': |
267 scm_obj = checkout.GitCheckout(full_dir, None, None, None, None) | 267 scm_obj = checkout.GitCheckout(full_dir, None, None, None, None) |
268 elif scm_type == None: | |
269 scm_obj = checkout.RawCheckout(full_dir, None, None) | |
270 else: | 268 else: |
271 parser.error('Couldn\'t determine the scm') | 269 parser.error('Couldn\'t determine the scm') |
272 | 270 |
273 # TODO(maruel): HACK, remove me. | 271 # TODO(maruel): HACK, remove me. |
274 # When run a build slave, make sure buildbot knows that the checkout was | 272 # When run a build slave, make sure buildbot knows that the checkout was |
275 # modified. | 273 # modified. |
276 if options.root_dir == 'src' and getpass.getuser() == 'chrome-bot': | 274 if options.root_dir == 'src' and getpass.getuser() == 'chrome-bot': |
277 # See sourcedirIsPatched() in: | 275 # See sourcedirIsPatched() in: |
278 # http://src.chromium.org/viewvc/chrome/trunk/tools/build/scripts/slave/ | 276 # http://src.chromium.org/viewvc/chrome/trunk/tools/build/scripts/slave/ |
279 # chromium_commands.py?view=markup | 277 # chromium_commands.py?view=markup |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 return RETURN_CODE_OK | 316 return RETURN_CODE_OK |
319 | 317 |
320 | 318 |
321 if __name__ == "__main__": | 319 if __name__ == "__main__": |
322 fix_encoding.fix_encoding() | 320 fix_encoding.fix_encoding() |
323 try: | 321 try: |
324 sys.exit(main()) | 322 sys.exit(main()) |
325 except KeyboardInterrupt: | 323 except KeyboardInterrupt: |
326 sys.stderr.write('interrupted\n') | 324 sys.stderr.write('interrupted\n') |
327 sys.exit(RETURN_CODE_OTHER_FAILURE) | 325 sys.exit(RETURN_CODE_OTHER_FAILURE) |
OLD | NEW |