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

Side by Side Diff: trychange.py

Issue 115217: Revert changes 15823 and 15824 because they broke gclient revert. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools/
Patch Set: Created 11 years, 7 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 | « tests/trychange_unittest.py ('k') | 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) 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 """Client-side script to send a try job to the try server. It communicates to 5 """Client-side script to send a try job to the try server. It communicates to
6 the try server by either writting to a svn repository or by directly connecting 6 the try server by either writting to a svn repository or by directly connecting
7 to the server by HTTP. 7 to the server by HTTP.
8 """ 8 """
9 9
10 10
11 import datetime 11 import datetime
12 import getpass 12 import getpass
13 import logging 13 import logging
14 import optparse 14 import optparse
15 import os 15 import os
16 import shutil 16 import shutil
17 import sys 17 import sys
18 import tempfile 18 import tempfile
19 import traceback 19 import traceback
20 import urllib 20 import urllib
21 21
22 import gcl 22 import gcl
23 import gclient
24 23
25 __version__ = '1.1' 24 __version__ = '1.1'
26 25
27 26
28 # Constants 27 # Constants
29 HELP_STRING = "Sorry, Tryserver is not available." 28 HELP_STRING = "Sorry, Tryserver is not available."
30 SCRIPT_PATH = os.path.join('tools', 'tryserver', 'tryserver.py') 29 SCRIPT_PATH = os.path.join('tools', 'tryserver', 'tryserver.py')
31 USAGE = r"""%prog [options] 30 USAGE = r"""%prog [options]
32 31
33 Client-side script to send a try job to the try server. It communicates to 32 Client-side script to send a try job to the try server. It communicates to
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 previous_cwd = os.getcwd() 125 previous_cwd = os.getcwd()
127 if root is None: 126 if root is None:
128 os.chdir(gcl.GetRepositoryRoot()) 127 os.chdir(gcl.GetRepositoryRoot())
129 else: 128 else:
130 os.chdir(root) 129 os.chdir(root)
131 130
132 diff = [] 131 diff = []
133 for file in files: 132 for file in files:
134 # Use svn info output instead of os.path.isdir because the latter fails 133 # Use svn info output instead of os.path.isdir because the latter fails
135 # when the file is deleted. 134 # when the file is deleted.
136 if gclient.CaptureSVNInfo(file).get("Node Kind") in ("dir", "directory"): 135 if gcl.GetSVNFileInfo(file).get("Node Kind") == "directory":
137 continue 136 continue
138 # If the user specified a custom diff command in their svn config file, 137 # If the user specified a custom diff command in their svn config file,
139 # then it'll be used when we do svn diff, which we don't want to happen 138 # then it'll be used when we do svn diff, which we don't want to happen
140 # since we want the unified diff. Using --diff-cmd=diff doesn't always 139 # since we want the unified diff. Using --diff-cmd=diff doesn't always
141 # work, since they can have another diff executable in their path that 140 # work, since they can have another diff executable in their path that
142 # gives different line endings. So we use a bogus temp directory as the 141 # gives different line endings. So we use a bogus temp directory as the
143 # config directory, which gets around these problems. 142 # config directory, which gets around these problems.
144 if sys.platform.startswith("win"): 143 if sys.platform.startswith("win"):
145 parent_dir = tempfile.gettempdir() 144 parent_dir = tempfile.gettempdir()
146 else: 145 else:
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 if patch_name == 'Unnamed': 496 if patch_name == 'Unnamed':
498 print "Note: use --name NAME to change the try's name." 497 print "Note: use --name NAME to change the try's name."
499 except (InvalidScript, NoTryServerAccess), e: 498 except (InvalidScript, NoTryServerAccess), e:
500 if swallow_exception: 499 if swallow_exception:
501 return 500 return
502 print e 501 print e
503 502
504 503
505 if __name__ == "__main__": 504 if __name__ == "__main__":
506 TryChange(None, None, False) 505 TryChange(None, None, False)
OLDNEW
« no previous file with comments | « tests/trychange_unittest.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698