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

Side by Side Diff: git_try.py

Issue 8036046: Revert r102783 "Support for |change| argument to |GetPreferredTrySlaves()|." (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 9 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 | « git_cl.py ('k') | presubmit_support.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/python 1 #!/usr/bin/python
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2011 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 git checkout.""" 5 """Wrapper for trychange.py for git checkout."""
6 6
7 import logging 7 import logging
8 import sys 8 import sys
9 9
10 import breakpad # pylint: disable=W0611 10 import breakpad # pylint: disable=W0611
11 11
12 from scm import GIT 12 from scm import GIT
13 import subprocess2 13 import subprocess2
14 import third_party.upload 14 import third_party.upload
15 import trychange 15 import trychange
16 import git_cl
17 16
18 17
19 def GetRietveldIssueNumber(): 18 def GetRietveldIssueNumber():
20 try: 19 try:
21 return GIT.Capture( 20 return GIT.Capture(
22 ['config', 'branch.%s.rietveldissue' % GIT.GetBranch(None)]) 21 ['config', 'branch.%s.rietveldissue' % GIT.GetBranch(None)])
23 except subprocess2.CalledProcessError: 22 except subprocess2.CalledProcessError:
24 return None 23 return None
25 24
26 25
(...skipping 20 matching lines...) Expand all
47 '--issue', GetRietveldIssueNumber(), 46 '--issue', GetRietveldIssueNumber(),
48 '--patchset', patchset, 47 '--patchset', patchset,
49 ]) 48 ])
50 else: 49 else:
51 rietveld_url = GetRietveldServerUrl() 50 rietveld_url = GetRietveldServerUrl()
52 if rietveld_url: 51 if rietveld_url:
53 args.extend(['--rietveld_url', GetRietveldServerUrl()]) 52 args.extend(['--rietveld_url', GetRietveldServerUrl()])
54 # Hack around a limitation in logging. 53 # Hack around a limitation in logging.
55 logging.getLogger().handlers = [] 54 logging.getLogger().handlers = []
56 try: 55 try:
57 cl = git_cl.Changelist()
58 change = cl.GetChange(cl.GetUpstreamBranch(), None)
59 sys.exit(trychange.TryChange( 56 sys.exit(trychange.TryChange(
60 args, change, file_list=[], swallow_exception=False, 57 args, file_list=[], swallow_exception=False,
61 prog='git try', 58 prog='git try',
62 extra_epilog='\n' 59 extra_epilog='\n'
63 'git try will diff against your tracked branch and will ' 60 'git try will diff against your tracked branch and will '
64 'detect your rietveld\n' 61 'detect your rietveld\n'
65 'code review if you are using git-cl\n')) 62 'code review if you are using git-cl\n'))
66 except third_party.upload.ClientLoginError, e: 63 except third_party.upload.ClientLoginError, e:
67 print('Got an exception while trying to log in to Rietveld.') 64 print('Got an exception while trying to log in to Rietveld.')
68 print(str(e)) 65 print(str(e))
OLDNEW
« no previous file with comments | « git_cl.py ('k') | presubmit_support.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698