Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 json | 10 import json |
| (...skipping 1094 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1105 if not options.reviewers and hook_results.reviewers: | 1105 if not options.reviewers and hook_results.reviewers: |
| 1106 options.reviewers = hook_results.reviewers | 1106 options.reviewers = hook_results.reviewers |
| 1107 | 1107 |
| 1108 # --no-ext-diff is broken in some versions of Git, so try to work around | 1108 # --no-ext-diff is broken in some versions of Git, so try to work around |
| 1109 # this by overriding the environment (but there is still a problem if the | 1109 # this by overriding the environment (but there is still a problem if the |
| 1110 # git config key "diff.external" is used). | 1110 # git config key "diff.external" is used). |
| 1111 env = os.environ.copy() | 1111 env = os.environ.copy() |
| 1112 if 'GIT_EXTERNAL_DIFF' in env: | 1112 if 'GIT_EXTERNAL_DIFF' in env: |
| 1113 del env['GIT_EXTERNAL_DIFF'] | 1113 del env['GIT_EXTERNAL_DIFF'] |
| 1114 subprocess2.call( | 1114 subprocess2.call( |
| 1115 ['git', 'diff', '--no-ext-diff', '--stat', '-M'] + args, env=env) | 1115 ['git', 'diff', '--no-ext-diff', '--stat', '-M', '-C', |
| 1116 '--find-copies-harder'] + args, env=env) | |
|
M-A Ruel
2012/05/22 20:26:11
You mean -C -C or -M -M?
There's no meaning to -M
cmp
2012/05/22 20:31:30
If -C implies -M, then this should change to -C --
cmp
2012/05/22 20:43:20
Done.
| |
| 1116 | 1117 |
| 1117 if settings.GetIsGerrit(): | 1118 if settings.GetIsGerrit(): |
| 1118 return GerritUpload(options, args, cl) | 1119 return GerritUpload(options, args, cl) |
| 1119 return RietveldUpload(options, args, cl) | 1120 return RietveldUpload(options, args, cl) |
| 1120 | 1121 |
| 1121 | 1122 |
| 1122 def SendUpstream(parser, args, cmd): | 1123 def SendUpstream(parser, args, cmd): |
| 1123 """Common code for CmdPush and CmdDCommit | 1124 """Common code for CmdPush and CmdDCommit |
| 1124 | 1125 |
| 1125 Squashed commit into a single. | 1126 Squashed commit into a single. |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1551 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) | 1552 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) |
| 1552 | 1553 |
| 1553 # Not a known command. Default to help. | 1554 # Not a known command. Default to help. |
| 1554 GenUsage(parser, 'help') | 1555 GenUsage(parser, 'help') |
| 1555 return CMDhelp(parser, argv) | 1556 return CMDhelp(parser, argv) |
| 1556 | 1557 |
| 1557 | 1558 |
| 1558 if __name__ == '__main__': | 1559 if __name__ == '__main__': |
| 1559 fix_encoding.fix_encoding() | 1560 fix_encoding.fix_encoding() |
| 1560 sys.exit(main(sys.argv[1:])) | 1561 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |