| 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 # Copyright (C) 2008 Evan Martin <martine@danga.com> | 6 # Copyright (C) 2008 Evan Martin <martine@danga.com> |
| 7 | 7 |
| 8 """A git-command for integrating reviews on Rietveld.""" | 8 """A git-command for integrating reviews on Rietveld.""" |
| 9 | 9 |
| 10 import logging | 10 import logging |
| (...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 self.has_issue = False | 493 self.has_issue = False |
| 494 | 494 |
| 495 def GetChange(self, upstream_branch, author): | 495 def GetChange(self, upstream_branch, author): |
| 496 root = RunCommand(['git', 'rev-parse', '--show-cdup']).strip() or '.' | 496 root = RunCommand(['git', 'rev-parse', '--show-cdup']).strip() or '.' |
| 497 absroot = os.path.abspath(root) | 497 absroot = os.path.abspath(root) |
| 498 | 498 |
| 499 # We use the sha1 of HEAD as a name of this change. | 499 # We use the sha1 of HEAD as a name of this change. |
| 500 name = RunCommand(['git', 'rev-parse', 'HEAD']).strip() | 500 name = RunCommand(['git', 'rev-parse', 'HEAD']).strip() |
| 501 # Need to pass a relative path for msysgit. | 501 # Need to pass a relative path for msysgit. |
| 502 try: | 502 try: |
| 503 files = scm.GIT.CaptureStatus([root], upstream_branch) | 503 files = scm.GIT.CaptureStatus([root], '.', upstream_branch) |
| 504 except subprocess2.CalledProcessError: | 504 except subprocess2.CalledProcessError: |
| 505 DieWithError( | 505 DieWithError( |
| 506 ('\nFailed to diff against upstream branch %s!\n\n' | 506 ('\nFailed to diff against upstream branch %s!\n\n' |
| 507 'This branch probably doesn\'t exist anymore. To reset the\n' | 507 'This branch probably doesn\'t exist anymore. To reset the\n' |
| 508 'tracking branch, please run\n' | 508 'tracking branch, please run\n' |
| 509 ' git branch --set-upstream %s trunk\n' | 509 ' git branch --set-upstream %s trunk\n' |
| 510 'replacing trunk with origin/master or the relevant branch') % | 510 'replacing trunk with origin/master or the relevant branch') % |
| 511 (upstream_branch, self.GetBranch())) | 511 (upstream_branch, self.GetBranch())) |
| 512 | 512 |
| 513 issue = ConvertToInteger(self.GetIssue()) | 513 issue = ConvertToInteger(self.GetIssue()) |
| (...skipping 902 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1416 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) | 1416 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) |
| 1417 | 1417 |
| 1418 # Not a known command. Default to help. | 1418 # Not a known command. Default to help. |
| 1419 GenUsage(parser, 'help') | 1419 GenUsage(parser, 'help') |
| 1420 return CMDhelp(parser, argv) | 1420 return CMDhelp(parser, argv) |
| 1421 | 1421 |
| 1422 | 1422 |
| 1423 if __name__ == '__main__': | 1423 if __name__ == '__main__': |
| 1424 fix_encoding.fix_encoding() | 1424 fix_encoding.fix_encoding() |
| 1425 sys.exit(main(sys.argv[1:])) | 1425 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |