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

Side by Side Diff: git-try

Issue 481006: Allow git-try to try rietveld changes directly. (Closed) Base URL: http://src.chromium.org/svn/trunk/tools/depot_tools/
Patch Set: Fix comments Created 10 years, 11 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 | tests/trychange_unittest.py » ('j') | trychange.py » ('J')
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) 2009 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2009 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 try: 10 try:
(...skipping 10 matching lines...) Expand all
21 ['config', 'branch.%s.rietveldissue' % GIT.GetBranch(None)], 21 ['config', 'branch.%s.rietveldissue' % GIT.GetBranch(None)],
22 error_ok=True) 22 error_ok=True)
23 23
24 24
25 def GetRietveldPatchsetNumber(): 25 def GetRietveldPatchsetNumber():
26 return GIT.Capture( 26 return GIT.Capture(
27 ['config', 'branch.%s.rietveldpatchset' % GIT.GetBranch(None)], 27 ['config', 'branch.%s.rietveldpatchset' % GIT.GetBranch(None)],
28 error_ok=True) 28 error_ok=True)
29 29
30 30
31 def GetRietveldServerUrl():
32 return GIT.Capture(
33 ['config', 'rietveld.server'], error_ok=True).strip()
34
35
31 if __name__ == '__main__': 36 if __name__ == '__main__':
32 args = sys.argv[:] 37 args = sys.argv[:]
33 patchset = GetRietveldPatchsetNumber() 38 patchset = GetRietveldPatchsetNumber()
34 if patchset: 39 if patchset:
Nico 2010/01/10 04:55:49 if patchset evaluates to true here…
35 args.extend([ 40 args.extend([
36 '--issue', GetRietveldIssueNumber(), 41 '--issue', GetRietveldIssueNumber(),
37 '--patchset', patchset, 42 '--patchset', patchset,
38 ]) 43 ])
44 else:
45 rietveld_url = GetRietveldServerUrl()
46 if rietveld_url:
47 args.extend(['--rietveld_url', GetRietveldServerUrl()])
39 # Hack around a limitation in logging. 48 # Hack around a limitation in logging.
40 logging.getLogger().handlers = [] 49 logging.getLogger().handlers = []
41 sys.exit(trychange.TryChange(args, [], False, 'git-try')) 50 sys.exit(trychange.TryChange(args, [], False, 'git-try'))
OLDNEW
« no previous file with comments | « no previous file | tests/trychange_unittest.py » ('j') | trychange.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698