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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 if not self.diff_against: | 276 if not self.diff_against: |
277 self.diff_against = scm.GIT.GetUpstreamBranch(self.checkout_root) | 277 self.diff_against = scm.GIT.GetUpstreamBranch(self.checkout_root) |
278 if not self.diff_against: | 278 if not self.diff_against: |
279 raise NoTryServerAccess( | 279 raise NoTryServerAccess( |
280 "Unable to determine default branch to diff against. " | 280 "Unable to determine default branch to diff against. " |
281 "Verify this branch is set up to track another" | 281 "Verify this branch is set up to track another" |
282 "(via the --track argument to \"git checkout -b ...\"") | 282 "(via the --track argument to \"git checkout -b ...\"") |
283 logging.info("GIT(%s)" % self.checkout_root) | 283 logging.info("GIT(%s)" % self.checkout_root) |
284 | 284 |
285 def CaptureStatus(self): | 285 def CaptureStatus(self): |
286 return scm.GIT.CaptureStatus(self.checkout_root, self.diff_against) | 286 return scm.GIT.CaptureStatus(self.checkout_root.replace(os.sep, '/'), |
| 287 self.diff_against) |
287 | 288 |
288 def GenerateDiff(self): | 289 def GenerateDiff(self): |
289 return scm.GIT.GenerateDiff(self.checkout_root, files=self.files, | 290 return scm.GIT.GenerateDiff(self.checkout_root, files=self.files, |
290 full_move=True, | 291 full_move=True, |
291 branch=self.diff_against) | 292 branch=self.diff_against) |
292 | 293 |
293 | 294 |
294 def _ParseSendChangeOptions(options): | 295 def _ParseSendChangeOptions(options): |
295 """Parse common options passed to _SendChangeHTTP and _SendChangeSVN.""" | 296 """Parse common options passed to _SendChangeHTTP and _SendChangeSVN.""" |
296 values = {} | 297 values = {} |
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
799 return 1 | 800 return 1 |
800 except (gclient_utils.Error, subprocess2.CalledProcessError), e: | 801 except (gclient_utils.Error, subprocess2.CalledProcessError), e: |
801 print >> sys.stderr, e | 802 print >> sys.stderr, e |
802 return 1 | 803 return 1 |
803 return 0 | 804 return 0 |
804 | 805 |
805 | 806 |
806 if __name__ == "__main__": | 807 if __name__ == "__main__": |
807 fix_encoding.fix_encoding() | 808 fix_encoding.fix_encoding() |
808 sys.exit(TryChange(None, None, [], False)) | 809 sys.exit(TryChange(None, None, [], False)) |
OLD | NEW |