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

Side by Side Diff: git_wktry.py

Issue 12255048: Fix lint error in git_wktry. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: prefix unused args Created 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | 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/python 1 #!/usr/bin/python
2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2013 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 """Wrapper for trychange.py for WebKit changes.""" 5 """Wrapper for trychange.py for WebKit changes."""
6 6
7 import errno 7 import errno
8 import logging 8 import logging
9 import os 9 import os
10 import sys 10 import sys
11 import tempfile 11 import tempfile
12 12
13 import git_cl 13 import git_cl
14 from scm import GIT 14 from scm import GIT
15 import trychange 15 import trychange
16 16
17 17
18 class ScopedTemporaryFile(object): 18 class ScopedTemporaryFile(object):
19 def __init__(self, **kwargs): 19 def __init__(self, **kwargs):
20 file_handle, self._path = tempfile.mkstemp(**kwargs) 20 file_handle, self._path = tempfile.mkstemp(**kwargs)
21 os.close(file_handle) 21 os.close(file_handle)
22 22
23 def __enter__(self): 23 def __enter__(self):
24 return self._path 24 return self._path
25 25
26 def __exit__(self, type, value, traceback): 26 def __exit__(self, _exc_type, _exc_value, _exc_traceback):
27 try: 27 try:
28 os.remove(self._path) 28 os.remove(self._path)
29 except OSError, e: 29 except OSError, e:
30 if e.errno != errno.ENOENT: 30 if e.errno != errno.ENOENT:
31 raise e 31 raise e
32 32
33 33
34 def generateDiff(path_to_write, chromium_src_root): 34 def generateDiff(path_to_write, chromium_src_root):
35 """Create the diff file to send to the try server. We prepend the WebKit 35 """Create the diff file to send to the try server. We prepend the WebKit
36 revision to the beginning of the diff so we can patch against ToT or other 36 revision to the beginning of the diff so we can patch against ToT or other
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 args.extend(argv) 77 args.extend(argv)
78 cl = git_cl.Changelist() 78 cl = git_cl.Changelist()
79 change = cl.GetChange(cl.GetUpstreamBranch(), None) 79 change = cl.GetChange(cl.GetUpstreamBranch(), None)
80 logging.getLogger().handlers = [] 80 logging.getLogger().handlers = []
81 return trychange.TryChange(args, change, 81 return trychange.TryChange(args, change,
82 swallow_exception=False, prog='git wktry') 82 swallow_exception=False, prog='git wktry')
83 83
84 84
85 if __name__ == '__main__': 85 if __name__ == '__main__':
86 sys.exit(main(sys.argv)) 86 sys.exit(main(sys.argv))
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698