Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(183)

Side by Side Diff: git_cl.py

Issue 10545107: Turn on git diff copy detection for git-cl upload. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: use --find-copies-harder Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/git_cl_test.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1110 matching lines...) Expand 10 before | Expand all | Expand 10 after
1121 if not options.reviewers and hook_results.reviewers: 1121 if not options.reviewers and hook_results.reviewers:
1122 options.reviewers = hook_results.reviewers 1122 options.reviewers = hook_results.reviewers
1123 1123
1124 # --no-ext-diff is broken in some versions of Git, so try to work around 1124 # --no-ext-diff is broken in some versions of Git, so try to work around
1125 # this by overriding the environment (but there is still a problem if the 1125 # this by overriding the environment (but there is still a problem if the
1126 # git config key "diff.external" is used). 1126 # git config key "diff.external" is used).
1127 env = os.environ.copy() 1127 env = os.environ.copy()
1128 if 'GIT_EXTERNAL_DIFF' in env: 1128 if 'GIT_EXTERNAL_DIFF' in env:
1129 del env['GIT_EXTERNAL_DIFF'] 1129 del env['GIT_EXTERNAL_DIFF']
1130 subprocess2.call( 1130 subprocess2.call(
1131 ['git', 'diff', '--no-ext-diff', '--stat', '-M'] + args, env=env) 1131 ['git', 'diff', '--no-ext-diff', '--stat', '--find-copies-harder'] + args,
1132 env=env)
1132 1133
1133 if settings.GetIsGerrit(): 1134 if settings.GetIsGerrit():
1134 return GerritUpload(options, args, cl) 1135 return GerritUpload(options, args, cl)
1135 return RietveldUpload(options, args, cl) 1136 return RietveldUpload(options, args, cl)
1136 1137
1137 1138
1138 def SendUpstream(parser, args, cmd): 1139 def SendUpstream(parser, args, cmd):
1139 """Common code for CmdPush and CmdDCommit 1140 """Common code for CmdPush and CmdDCommit
1140 1141
1141 Squashed commit into a single. 1142 Squashed commit into a single.
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
1567 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) 1568 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e)))
1568 1569
1569 # Not a known command. Default to help. 1570 # Not a known command. Default to help.
1570 GenUsage(parser, 'help') 1571 GenUsage(parser, 'help')
1571 return CMDhelp(parser, argv) 1572 return CMDhelp(parser, argv)
1572 1573
1573 1574
1574 if __name__ == '__main__': 1575 if __name__ == '__main__':
1575 fix_encoding.fix_encoding() 1576 fix_encoding.fix_encoding()
1576 sys.exit(main(sys.argv[1:])) 1577 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « no previous file | tests/git_cl_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698