OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env 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 | 5 |
6 """Client-side script to send a try job to the try server. It communicates to | 6 """Client-side script to send a try job to the try server. It communicates to |
7 the try server by either writting to a svn repository or by directly connecting | 7 the try server by either writting to a svn repository or by directly connecting |
8 to the server by HTTP. | 8 to the server by HTTP. |
9 """ | 9 """ |
10 | 10 |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 if not self.diff_against: | 268 if not self.diff_against: |
269 self.diff_against = scm.GIT.GetUpstreamBranch(self.checkout_root) | 269 self.diff_against = scm.GIT.GetUpstreamBranch(self.checkout_root) |
270 if not self.diff_against: | 270 if not self.diff_against: |
271 raise NoTryServerAccess( | 271 raise NoTryServerAccess( |
272 "Unable to determine default branch to diff against. " | 272 "Unable to determine default branch to diff against. " |
273 "Verify this branch is set up to track another" | 273 "Verify this branch is set up to track another" |
274 "(via the --track argument to \"git checkout -b ...\"") | 274 "(via the --track argument to \"git checkout -b ...\"") |
275 logging.info("GIT(%s)" % self.checkout_root) | 275 logging.info("GIT(%s)" % self.checkout_root) |
276 | 276 |
277 def CaptureStatus(self): | 277 def CaptureStatus(self): |
278 return scm.GIT.CaptureStatus(self.checkout_root.replace(os.sep, '/'), | 278 return scm.GIT.CaptureStatus( |
279 self.diff_against) | 279 [], |
| 280 self.checkout_root.replace(os.sep, '/'), |
| 281 self.diff_against) |
280 | 282 |
281 def GenerateDiff(self): | 283 def GenerateDiff(self): |
282 return scm.GIT.GenerateDiff(self.checkout_root, files=self.files, | 284 return scm.GIT.GenerateDiff( |
283 full_move=True, | 285 self.checkout_root, |
284 branch=self.diff_against) | 286 files=self.files, |
| 287 full_move=True, |
| 288 branch=self.diff_against) |
285 | 289 |
286 | 290 |
287 def _ParseSendChangeOptions(options): | 291 def _ParseSendChangeOptions(options): |
288 """Parse common options passed to _SendChangeHTTP and _SendChangeSVN.""" | 292 """Parse common options passed to _SendChangeHTTP and _SendChangeSVN.""" |
289 values = {} | 293 values = {} |
290 if options.email: | 294 if options.email: |
291 values['email'] = options.email | 295 values['email'] = options.email |
292 values['user'] = options.user | 296 values['user'] = options.user |
293 values['name'] = options.name | 297 values['name'] = options.name |
294 if options.bot: | 298 if options.bot: |
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
806 return 1 | 810 return 1 |
807 except (gclient_utils.Error, subprocess2.CalledProcessError), e: | 811 except (gclient_utils.Error, subprocess2.CalledProcessError), e: |
808 print >> sys.stderr, e | 812 print >> sys.stderr, e |
809 return 1 | 813 return 1 |
810 return 0 | 814 return 0 |
811 | 815 |
812 | 816 |
813 if __name__ == "__main__": | 817 if __name__ == "__main__": |
814 fix_encoding.fix_encoding() | 818 fix_encoding.fix_encoding() |
815 sys.exit(TryChange(None, None, False)) | 819 sys.exit(TryChange(None, None, False)) |
OLD | NEW |