OLD | NEW |
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 import datetime | 10 import datetime |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 except (IOError, OSError): | 125 except (IOError, OSError): |
126 return None | 126 return None |
127 | 127 |
128 | 128 |
129 class GIT(SCM): | 129 class GIT(SCM): |
130 """Gathers the options and diff for a git checkout.""" | 130 """Gathers the options and diff for a git checkout.""" |
131 def __init__(self, *args, **kwargs): | 131 def __init__(self, *args, **kwargs): |
132 SCM.__init__(self, *args, **kwargs) | 132 SCM.__init__(self, *args, **kwargs) |
133 self.checkout_root = scm.GIT.GetCheckoutRoot(os.getcwd()) | 133 self.checkout_root = scm.GIT.GetCheckoutRoot(os.getcwd()) |
134 if not self.options.diff: | 134 if not self.options.diff: |
135 self.options.diff = scm.GIT.GenerateDiff(self.checkout_root) | 135 self.options.diff = scm.GIT.GenerateDiff(self.checkout_root, |
| 136 full_move=True) |
136 if not self.options.name: | 137 if not self.options.name: |
137 self.options.name = scm.GIT.GetPatchName(self.checkout_root) | 138 self.options.name = scm.GIT.GetPatchName(self.checkout_root) |
138 if not self.options.email: | 139 if not self.options.email: |
139 self.options.email = scm.GIT.GetEmail(self.checkout_root) | 140 self.options.email = scm.GIT.GetEmail(self.checkout_root) |
140 | 141 |
141 def GetLocalRoot(self): | 142 def GetLocalRoot(self): |
142 """Return the path of the repository root.""" | 143 """Return the path of the repository root.""" |
143 return self.checkout_root | 144 return self.checkout_root |
144 | 145 |
145 def GetBots(self): | 146 def GetBots(self): |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 except (InvalidScript, NoTryServerAccess), e: | 479 except (InvalidScript, NoTryServerAccess), e: |
479 if swallow_exception: | 480 if swallow_exception: |
480 return 1 | 481 return 1 |
481 print e | 482 print e |
482 return 1 | 483 return 1 |
483 return 0 | 484 return 0 |
484 | 485 |
485 | 486 |
486 if __name__ == "__main__": | 487 if __name__ == "__main__": |
487 sys.exit(TryChange(None, [], False)) | 488 sys.exit(TryChange(None, [], False)) |
OLD | NEW |